1#![doc = "MAVLink common dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
21pub const DIALECT_NUMBER: u8 = 0u8;
22#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
23#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24#[cfg_attr(feature = "serde", serde(tag = "type"))]
25#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26#[repr(u32)]
27#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
28pub enum ActuatorConfiguration {
29 #[doc = "Do nothing."]
30 ACTUATOR_CONFIGURATION_NONE = 0,
31 #[doc = "Command the actuator to beep now."]
32 ACTUATOR_CONFIGURATION_BEEP = 1,
33 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
34 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
35 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
36 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
37 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
38 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
39 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
40 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
41}
42impl ActuatorConfiguration {
43 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
44}
45impl Default for ActuatorConfiguration {
46 fn default() -> Self {
47 Self::DEFAULT
48 }
49}
50#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
51#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
52#[cfg_attr(feature = "serde", serde(tag = "type"))]
53#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
54#[repr(u32)]
55#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
56pub enum ActuatorOutputFunction {
57 #[doc = "No function (disabled)."]
58 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
59 #[doc = "Motor 1"]
60 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
61 #[doc = "Motor 2"]
62 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
63 #[doc = "Motor 3"]
64 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
65 #[doc = "Motor 4"]
66 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
67 #[doc = "Motor 5"]
68 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
69 #[doc = "Motor 6"]
70 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
71 #[doc = "Motor 7"]
72 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
73 #[doc = "Motor 8"]
74 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
75 #[doc = "Motor 9"]
76 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
77 #[doc = "Motor 10"]
78 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
79 #[doc = "Motor 11"]
80 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
81 #[doc = "Motor 12"]
82 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
83 #[doc = "Motor 13"]
84 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
85 #[doc = "Motor 14"]
86 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
87 #[doc = "Motor 15"]
88 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
89 #[doc = "Motor 16"]
90 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
91 #[doc = "Servo 1"]
92 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
93 #[doc = "Servo 2"]
94 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
95 #[doc = "Servo 3"]
96 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
97 #[doc = "Servo 4"]
98 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
99 #[doc = "Servo 5"]
100 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
101 #[doc = "Servo 6"]
102 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
103 #[doc = "Servo 7"]
104 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
105 #[doc = "Servo 8"]
106 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
107 #[doc = "Servo 9"]
108 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
109 #[doc = "Servo 10"]
110 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
111 #[doc = "Servo 11"]
112 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
113 #[doc = "Servo 12"]
114 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
115 #[doc = "Servo 13"]
116 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
117 #[doc = "Servo 14"]
118 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
119 #[doc = "Servo 15"]
120 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
121 #[doc = "Servo 16"]
122 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
123}
124impl ActuatorOutputFunction {
125 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
126}
127impl Default for ActuatorOutputFunction {
128 fn default() -> Self {
129 Self::DEFAULT
130 }
131}
132#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
134#[cfg_attr(feature = "serde", serde(tag = "type"))]
135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
136#[repr(u32)]
137#[doc = "Enumeration of the ADSB altimeter types"]
138pub enum AdsbAltitudeType {
139 #[doc = "Altitude reported from a Baro source using QNH reference"]
140 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
141 #[doc = "Altitude reported from a GNSS source"]
142 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
143}
144impl AdsbAltitudeType {
145 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
146}
147impl Default for AdsbAltitudeType {
148 fn default() -> Self {
149 Self::DEFAULT
150 }
151}
152#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
154#[cfg_attr(feature = "serde", serde(tag = "type"))]
155#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
156#[repr(u32)]
157#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
158pub enum AdsbEmitterType {
159 ADSB_EMITTER_TYPE_NO_INFO = 0,
160 ADSB_EMITTER_TYPE_LIGHT = 1,
161 ADSB_EMITTER_TYPE_SMALL = 2,
162 ADSB_EMITTER_TYPE_LARGE = 3,
163 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
164 ADSB_EMITTER_TYPE_HEAVY = 5,
165 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
166 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
167 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
168 ADSB_EMITTER_TYPE_GLIDER = 9,
169 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
170 ADSB_EMITTER_TYPE_PARACHUTE = 11,
171 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
172 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
173 ADSB_EMITTER_TYPE_UAV = 14,
174 ADSB_EMITTER_TYPE_SPACE = 15,
175 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
176 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
177 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
178 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
179}
180impl AdsbEmitterType {
181 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
182}
183impl Default for AdsbEmitterType {
184 fn default() -> Self {
185 Self::DEFAULT
186 }
187}
188bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
189impl AdsbFlags {
190 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
191}
192impl Default for AdsbFlags {
193 fn default() -> Self {
194 Self::DEFAULT
195 }
196}
197bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
198impl AisFlags {
199 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
200}
201impl Default for AisFlags {
202 fn default() -> Self {
203 Self::DEFAULT
204 }
205}
206#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
207#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
208#[cfg_attr(feature = "serde", serde(tag = "type"))]
209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
210#[repr(u32)]
211#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
212pub enum AisNavStatus {
213 #[doc = "Under way using engine."]
214 UNDER_WAY = 0,
215 AIS_NAV_ANCHORED = 1,
216 AIS_NAV_UN_COMMANDED = 2,
217 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
218 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
219 AIS_NAV_MOORED = 5,
220 AIS_NAV_AGROUND = 6,
221 AIS_NAV_FISHING = 7,
222 AIS_NAV_SAILING = 8,
223 AIS_NAV_RESERVED_HSC = 9,
224 AIS_NAV_RESERVED_WIG = 10,
225 AIS_NAV_RESERVED_1 = 11,
226 AIS_NAV_RESERVED_2 = 12,
227 AIS_NAV_RESERVED_3 = 13,
228 #[doc = "Search And Rescue Transponder."]
229 AIS_NAV_AIS_SART = 14,
230 #[doc = "Not available (default)."]
231 AIS_NAV_UNKNOWN = 15,
232}
233impl AisNavStatus {
234 pub const DEFAULT: Self = Self::UNDER_WAY;
235}
236impl Default for AisNavStatus {
237 fn default() -> Self {
238 Self::DEFAULT
239 }
240}
241#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
242#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
243#[cfg_attr(feature = "serde", serde(tag = "type"))]
244#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
245#[repr(u32)]
246#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
247pub enum AisType {
248 #[doc = "Not available (default)."]
249 AIS_TYPE_UNKNOWN = 0,
250 AIS_TYPE_RESERVED_1 = 1,
251 AIS_TYPE_RESERVED_2 = 2,
252 AIS_TYPE_RESERVED_3 = 3,
253 AIS_TYPE_RESERVED_4 = 4,
254 AIS_TYPE_RESERVED_5 = 5,
255 AIS_TYPE_RESERVED_6 = 6,
256 AIS_TYPE_RESERVED_7 = 7,
257 AIS_TYPE_RESERVED_8 = 8,
258 AIS_TYPE_RESERVED_9 = 9,
259 AIS_TYPE_RESERVED_10 = 10,
260 AIS_TYPE_RESERVED_11 = 11,
261 AIS_TYPE_RESERVED_12 = 12,
262 AIS_TYPE_RESERVED_13 = 13,
263 AIS_TYPE_RESERVED_14 = 14,
264 AIS_TYPE_RESERVED_15 = 15,
265 AIS_TYPE_RESERVED_16 = 16,
266 AIS_TYPE_RESERVED_17 = 17,
267 AIS_TYPE_RESERVED_18 = 18,
268 AIS_TYPE_RESERVED_19 = 19,
269 #[doc = "Wing In Ground effect."]
270 AIS_TYPE_WIG = 20,
271 AIS_TYPE_WIG_HAZARDOUS_A = 21,
272 AIS_TYPE_WIG_HAZARDOUS_B = 22,
273 AIS_TYPE_WIG_HAZARDOUS_C = 23,
274 AIS_TYPE_WIG_HAZARDOUS_D = 24,
275 AIS_TYPE_WIG_RESERVED_1 = 25,
276 AIS_TYPE_WIG_RESERVED_2 = 26,
277 AIS_TYPE_WIG_RESERVED_3 = 27,
278 AIS_TYPE_WIG_RESERVED_4 = 28,
279 AIS_TYPE_WIG_RESERVED_5 = 29,
280 AIS_TYPE_FISHING = 30,
281 AIS_TYPE_TOWING = 31,
282 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
283 AIS_TYPE_TOWING_LARGE = 32,
284 #[doc = "Dredging or other underwater ops."]
285 AIS_TYPE_DREDGING = 33,
286 AIS_TYPE_DIVING = 34,
287 AIS_TYPE_MILITARY = 35,
288 AIS_TYPE_SAILING = 36,
289 AIS_TYPE_PLEASURE = 37,
290 AIS_TYPE_RESERVED_20 = 38,
291 AIS_TYPE_RESERVED_21 = 39,
292 #[doc = "High Speed Craft."]
293 AIS_TYPE_HSC = 40,
294 AIS_TYPE_HSC_HAZARDOUS_A = 41,
295 AIS_TYPE_HSC_HAZARDOUS_B = 42,
296 AIS_TYPE_HSC_HAZARDOUS_C = 43,
297 AIS_TYPE_HSC_HAZARDOUS_D = 44,
298 AIS_TYPE_HSC_RESERVED_1 = 45,
299 AIS_TYPE_HSC_RESERVED_2 = 46,
300 AIS_TYPE_HSC_RESERVED_3 = 47,
301 AIS_TYPE_HSC_RESERVED_4 = 48,
302 AIS_TYPE_HSC_UNKNOWN = 49,
303 AIS_TYPE_PILOT = 50,
304 #[doc = "Search And Rescue vessel."]
305 AIS_TYPE_SAR = 51,
306 AIS_TYPE_TUG = 52,
307 AIS_TYPE_PORT_TENDER = 53,
308 #[doc = "Anti-pollution equipment."]
309 AIS_TYPE_ANTI_POLLUTION = 54,
310 AIS_TYPE_LAW_ENFORCEMENT = 55,
311 AIS_TYPE_SPARE_LOCAL_1 = 56,
312 AIS_TYPE_SPARE_LOCAL_2 = 57,
313 AIS_TYPE_MEDICAL_TRANSPORT = 58,
314 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
315 AIS_TYPE_NONECOMBATANT = 59,
316 AIS_TYPE_PASSENGER = 60,
317 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
318 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
319 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
320 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
321 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
322 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
323 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
324 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
325 AIS_TYPE_PASSENGER_UNKNOWN = 69,
326 AIS_TYPE_CARGO = 70,
327 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
328 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
329 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
330 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
331 AIS_TYPE_CARGO_RESERVED_1 = 75,
332 AIS_TYPE_CARGO_RESERVED_2 = 76,
333 AIS_TYPE_CARGO_RESERVED_3 = 77,
334 AIS_TYPE_CARGO_RESERVED_4 = 78,
335 AIS_TYPE_CARGO_UNKNOWN = 79,
336 AIS_TYPE_TANKER = 80,
337 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
338 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
339 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
340 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
341 AIS_TYPE_TANKER_RESERVED_1 = 85,
342 AIS_TYPE_TANKER_RESERVED_2 = 86,
343 AIS_TYPE_TANKER_RESERVED_3 = 87,
344 AIS_TYPE_TANKER_RESERVED_4 = 88,
345 AIS_TYPE_TANKER_UNKNOWN = 89,
346 AIS_TYPE_OTHER = 90,
347 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
348 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
349 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
350 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
351 AIS_TYPE_OTHER_RESERVED_1 = 95,
352 AIS_TYPE_OTHER_RESERVED_2 = 96,
353 AIS_TYPE_OTHER_RESERVED_3 = 97,
354 AIS_TYPE_OTHER_RESERVED_4 = 98,
355 AIS_TYPE_OTHER_UNKNOWN = 99,
356}
357impl AisType {
358 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
359}
360impl Default for AisType {
361 fn default() -> Self {
362 Self::DEFAULT
363 }
364}
365bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
366impl AttitudeTargetTypemask {
367 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
368}
369impl Default for AttitudeTargetTypemask {
370 fn default() -> Self {
371 Self::DEFAULT
372 }
373}
374#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
375#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
376#[cfg_attr(feature = "serde", serde(tag = "type"))]
377#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
378#[repr(u32)]
379#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
380pub enum AutotuneAxis {
381 #[doc = "Autotune roll axis."]
382 AUTOTUNE_AXIS_ROLL = 1,
383 #[doc = "Autotune pitch axis."]
384 AUTOTUNE_AXIS_PITCH = 2,
385 #[doc = "Autotune yaw axis."]
386 AUTOTUNE_AXIS_YAW = 4,
387}
388impl AutotuneAxis {
389 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
390}
391impl Default for AutotuneAxis {
392 fn default() -> Self {
393 Self::DEFAULT
394 }
395}
396bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
397impl CameraCapFlags {
398 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
399}
400impl Default for CameraCapFlags {
401 fn default() -> Self {
402 Self::DEFAULT
403 }
404}
405#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
407#[cfg_attr(feature = "serde", serde(tag = "type"))]
408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
409#[repr(u32)]
410#[doc = "Camera Modes."]
411pub enum CameraMode {
412 #[doc = "Camera is in image/photo capture mode."]
413 CAMERA_MODE_IMAGE = 0,
414 #[doc = "Camera is in video capture mode."]
415 CAMERA_MODE_VIDEO = 1,
416 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
417 CAMERA_MODE_IMAGE_SURVEY = 2,
418}
419impl CameraMode {
420 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
421}
422impl Default for CameraMode {
423 fn default() -> Self {
424 Self::DEFAULT
425 }
426}
427#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
428#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
429#[cfg_attr(feature = "serde", serde(tag = "type"))]
430#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
431#[repr(u32)]
432#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
433pub enum CameraSource {
434 #[doc = "Default camera source."]
435 CAMERA_SOURCE_DEFAULT = 0,
436 #[doc = "RGB camera source."]
437 CAMERA_SOURCE_RGB = 1,
438 #[doc = "IR camera source."]
439 CAMERA_SOURCE_IR = 2,
440 #[doc = "NDVI camera source."]
441 CAMERA_SOURCE_NDVI = 3,
442}
443impl CameraSource {
444 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
445}
446impl Default for CameraSource {
447 fn default() -> Self {
448 Self::DEFAULT
449 }
450}
451#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
452#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
453#[cfg_attr(feature = "serde", serde(tag = "type"))]
454#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
455#[repr(u32)]
456#[doc = "Camera tracking modes"]
457pub enum CameraTrackingMode {
458 #[doc = "Not tracking"]
459 CAMERA_TRACKING_MODE_NONE = 0,
460 #[doc = "Target is a point"]
461 CAMERA_TRACKING_MODE_POINT = 1,
462 #[doc = "Target is a rectangle"]
463 CAMERA_TRACKING_MODE_RECTANGLE = 2,
464}
465impl CameraTrackingMode {
466 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
467}
468impl Default for CameraTrackingMode {
469 fn default() -> Self {
470 Self::DEFAULT
471 }
472}
473#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
474#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
475#[cfg_attr(feature = "serde", serde(tag = "type"))]
476#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
477#[repr(u32)]
478#[doc = "Camera tracking status flags"]
479pub enum CameraTrackingStatusFlags {
480 #[doc = "Camera is not tracking"]
481 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
482 #[doc = "Camera is tracking"]
483 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
484 #[doc = "Camera tracking in error state"]
485 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
486}
487impl CameraTrackingStatusFlags {
488 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
489}
490impl Default for CameraTrackingStatusFlags {
491 fn default() -> Self {
492 Self::DEFAULT
493 }
494}
495bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
496impl CameraTrackingTargetData {
497 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
498}
499impl Default for CameraTrackingTargetData {
500 fn default() -> Self {
501 Self::DEFAULT
502 }
503}
504#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
505#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
506#[cfg_attr(feature = "serde", serde(tag = "type"))]
507#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
508#[repr(u32)]
509#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
510pub enum CameraZoomType {
511 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
512 ZOOM_TYPE_STEP = 0,
513 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
514 ZOOM_TYPE_CONTINUOUS = 1,
515 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
516 ZOOM_TYPE_RANGE = 2,
517 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
518 ZOOM_TYPE_FOCAL_LENGTH = 3,
519 #[doc = "Zoom value as horizontal field of view in degrees."]
520 ZOOM_TYPE_HORIZONTAL_FOV = 4,
521}
522impl CameraZoomType {
523 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
524}
525impl Default for CameraZoomType {
526 fn default() -> Self {
527 Self::DEFAULT
528 }
529}
530#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
531#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
532#[cfg_attr(feature = "serde", serde(tag = "type"))]
533#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
534#[repr(u32)]
535pub enum CanFilterOp {
536 CAN_FILTER_REPLACE = 0,
537 CAN_FILTER_ADD = 1,
538 CAN_FILTER_REMOVE = 2,
539}
540impl CanFilterOp {
541 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
542}
543impl Default for CanFilterOp {
544 fn default() -> Self {
545 Self::DEFAULT
546 }
547}
548#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
549#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
550#[cfg_attr(feature = "serde", serde(tag = "type"))]
551#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
552#[repr(u32)]
553#[doc = "Possible responses from a CELLULAR_CONFIG message."]
554pub enum CellularConfigResponse {
555 #[doc = "Changes accepted."]
556 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
557 #[doc = "Invalid APN."]
558 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
559 #[doc = "Invalid PIN."]
560 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
561 #[doc = "Changes rejected."]
562 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
563 #[doc = "PUK is required to unblock SIM card."]
564 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
565}
566impl CellularConfigResponse {
567 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
568}
569impl Default for CellularConfigResponse {
570 fn default() -> Self {
571 Self::DEFAULT
572 }
573}
574#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
575#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
576#[cfg_attr(feature = "serde", serde(tag = "type"))]
577#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
578#[repr(u32)]
579#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
580pub enum CellularNetworkFailedReason {
581 #[doc = "No error"]
582 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
583 #[doc = "Error state is unknown"]
584 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
585 #[doc = "SIM is required for the modem but missing"]
586 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
587 #[doc = "SIM is available, but not usable for connection"]
588 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
589}
590impl CellularNetworkFailedReason {
591 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
592}
593impl Default for CellularNetworkFailedReason {
594 fn default() -> Self {
595 Self::DEFAULT
596 }
597}
598#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
599#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
600#[cfg_attr(feature = "serde", serde(tag = "type"))]
601#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
602#[repr(u32)]
603#[doc = "Cellular network radio type"]
604pub enum CellularNetworkRadioType {
605 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
606 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
607 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
608 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
609 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
610}
611impl CellularNetworkRadioType {
612 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
613}
614impl Default for CellularNetworkRadioType {
615 fn default() -> Self {
616 Self::DEFAULT
617 }
618}
619#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
621#[cfg_attr(feature = "serde", serde(tag = "type"))]
622#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
623#[repr(u32)]
624#[doc = "These flags encode the cellular network status"]
625pub enum CellularStatusFlag {
626 #[doc = "State unknown or not reportable."]
627 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
628 #[doc = "Modem is unusable"]
629 CELLULAR_STATUS_FLAG_FAILED = 1,
630 #[doc = "Modem is being initialized"]
631 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
632 #[doc = "Modem is locked"]
633 CELLULAR_STATUS_FLAG_LOCKED = 3,
634 #[doc = "Modem is not enabled and is powered down"]
635 CELLULAR_STATUS_FLAG_DISABLED = 4,
636 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
637 CELLULAR_STATUS_FLAG_DISABLING = 5,
638 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
639 CELLULAR_STATUS_FLAG_ENABLING = 6,
640 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
641 CELLULAR_STATUS_FLAG_ENABLED = 7,
642 #[doc = "Modem is searching for a network provider to register"]
643 CELLULAR_STATUS_FLAG_SEARCHING = 8,
644 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
645 CELLULAR_STATUS_FLAG_REGISTERED = 9,
646 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
647 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
648 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
649 CELLULAR_STATUS_FLAG_CONNECTING = 11,
650 #[doc = "One or more packet data bearers is active and connected"]
651 CELLULAR_STATUS_FLAG_CONNECTED = 12,
652}
653impl CellularStatusFlag {
654 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
655}
656impl Default for CellularStatusFlag {
657 fn default() -> Self {
658 Self::DEFAULT
659 }
660}
661#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
662#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
663#[cfg_attr(feature = "serde", serde(tag = "type"))]
664#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
665#[repr(u32)]
666#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
667pub enum CompMetadataType {
668 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
669 COMP_METADATA_TYPE_GENERAL = 0,
670 #[doc = "Parameter meta data."]
671 COMP_METADATA_TYPE_PARAMETER = 1,
672 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
673 COMP_METADATA_TYPE_COMMANDS = 2,
674 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
675 COMP_METADATA_TYPE_PERIPHERALS = 3,
676 #[doc = "Meta data for the events interface."]
677 COMP_METADATA_TYPE_EVENTS = 4,
678 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
679 COMP_METADATA_TYPE_ACTUATORS = 5,
680}
681impl CompMetadataType {
682 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
683}
684impl Default for CompMetadataType {
685 fn default() -> Self {
686 Self::DEFAULT
687 }
688}
689#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
690#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
691#[cfg_attr(feature = "serde", serde(tag = "type"))]
692#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
693#[repr(u32)]
694#[doc = "Indicates the ESC connection type."]
695pub enum EscConnectionType {
696 #[doc = "Traditional PPM ESC."]
697 ESC_CONNECTION_TYPE_PPM = 0,
698 #[doc = "Serial Bus connected ESC."]
699 ESC_CONNECTION_TYPE_SERIAL = 1,
700 #[doc = "One Shot PPM ESC."]
701 ESC_CONNECTION_TYPE_ONESHOT = 2,
702 #[doc = "I2C ESC."]
703 ESC_CONNECTION_TYPE_I2C = 3,
704 #[doc = "CAN-Bus ESC."]
705 ESC_CONNECTION_TYPE_CAN = 4,
706 #[doc = "DShot ESC."]
707 ESC_CONNECTION_TYPE_DSHOT = 5,
708}
709impl EscConnectionType {
710 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
711}
712impl Default for EscConnectionType {
713 fn default() -> Self {
714 Self::DEFAULT
715 }
716}
717bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
718impl EscFailureFlags {
719 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
720}
721impl Default for EscFailureFlags {
722 fn default() -> Self {
723 Self::DEFAULT
724 }
725}
726bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
727impl EstimatorStatusFlags {
728 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
729}
730impl Default for EstimatorStatusFlags {
731 fn default() -> Self {
732 Self::DEFAULT
733 }
734}
735#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
736#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
737#[cfg_attr(feature = "serde", serde(tag = "type"))]
738#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
739#[repr(u32)]
740#[doc = "List of possible failure type to inject."]
741pub enum FailureType {
742 #[doc = "No failure injected, used to reset a previous failure."]
743 FAILURE_TYPE_OK = 0,
744 #[doc = "Sets unit off, so completely non-responsive."]
745 FAILURE_TYPE_OFF = 1,
746 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
747 FAILURE_TYPE_STUCK = 2,
748 #[doc = "Unit is reporting complete garbage."]
749 FAILURE_TYPE_GARBAGE = 3,
750 #[doc = "Unit is consistently wrong."]
751 FAILURE_TYPE_WRONG = 4,
752 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
753 FAILURE_TYPE_SLOW = 5,
754 #[doc = "Data of unit is delayed in time."]
755 FAILURE_TYPE_DELAYED = 6,
756 #[doc = "Unit is sometimes working, sometimes not."]
757 FAILURE_TYPE_INTERMITTENT = 7,
758}
759impl FailureType {
760 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
761}
762impl Default for FailureType {
763 fn default() -> Self {
764 Self::DEFAULT
765 }
766}
767#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
768#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
769#[cfg_attr(feature = "serde", serde(tag = "type"))]
770#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
771#[repr(u32)]
772#[doc = "List of possible units where failures can be injected."]
773pub enum FailureUnit {
774 FAILURE_UNIT_SENSOR_GYRO = 0,
775 FAILURE_UNIT_SENSOR_ACCEL = 1,
776 FAILURE_UNIT_SENSOR_MAG = 2,
777 FAILURE_UNIT_SENSOR_BARO = 3,
778 FAILURE_UNIT_SENSOR_GPS = 4,
779 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
780 FAILURE_UNIT_SENSOR_VIO = 6,
781 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
782 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
783 FAILURE_UNIT_SYSTEM_BATTERY = 100,
784 FAILURE_UNIT_SYSTEM_MOTOR = 101,
785 FAILURE_UNIT_SYSTEM_SERVO = 102,
786 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
787 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
788 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
789}
790impl FailureUnit {
791 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
792}
793impl Default for FailureUnit {
794 fn default() -> Self {
795 Self::DEFAULT
796 }
797}
798#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
799#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
800#[cfg_attr(feature = "serde", serde(tag = "type"))]
801#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
802#[repr(u32)]
803pub enum FenceBreach {
804 #[doc = "No last fence breach"]
805 FENCE_BREACH_NONE = 0,
806 #[doc = "Breached minimum altitude"]
807 FENCE_BREACH_MINALT = 1,
808 #[doc = "Breached maximum altitude"]
809 FENCE_BREACH_MAXALT = 2,
810 #[doc = "Breached fence boundary"]
811 FENCE_BREACH_BOUNDARY = 3,
812}
813impl FenceBreach {
814 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
815}
816impl Default for FenceBreach {
817 fn default() -> Self {
818 Self::DEFAULT
819 }
820}
821#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
822#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
823#[cfg_attr(feature = "serde", serde(tag = "type"))]
824#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
825#[repr(u32)]
826#[doc = "Actions being taken to mitigate/prevent fence breach"]
827pub enum FenceMitigate {
828 #[doc = "Unknown"]
829 FENCE_MITIGATE_UNKNOWN = 0,
830 #[doc = "No actions being taken"]
831 FENCE_MITIGATE_NONE = 1,
832 #[doc = "Velocity limiting active to prevent breach"]
833 FENCE_MITIGATE_VEL_LIMIT = 2,
834}
835impl FenceMitigate {
836 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
837}
838impl Default for FenceMitigate {
839 fn default() -> Self {
840 Self::DEFAULT
841 }
842}
843#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
845#[cfg_attr(feature = "serde", serde(tag = "type"))]
846#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
847#[repr(u32)]
848#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
849pub enum FenceType {
850 #[doc = "Maximum altitude fence"]
851 FENCE_TYPE_ALT_MAX = 1,
852 #[doc = "Circle fence"]
853 FENCE_TYPE_CIRCLE = 2,
854 #[doc = "Polygon fence"]
855 FENCE_TYPE_POLYGON = 4,
856 #[doc = "Minimum altitude fence"]
857 FENCE_TYPE_ALT_MIN = 8,
858}
859impl FenceType {
860 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
861}
862impl Default for FenceType {
863 fn default() -> Self {
864 Self::DEFAULT
865 }
866}
867#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
868#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
869#[cfg_attr(feature = "serde", serde(tag = "type"))]
870#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
871#[repr(u32)]
872#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
873pub enum FirmwareVersionType {
874 #[doc = "development release"]
875 FIRMWARE_VERSION_TYPE_DEV = 0,
876 #[doc = "alpha release"]
877 FIRMWARE_VERSION_TYPE_ALPHA = 64,
878 #[doc = "beta release"]
879 FIRMWARE_VERSION_TYPE_BETA = 128,
880 #[doc = "release candidate"]
881 FIRMWARE_VERSION_TYPE_RC = 192,
882 #[doc = "official stable release"]
883 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
884}
885impl FirmwareVersionType {
886 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
887}
888impl Default for FirmwareVersionType {
889 fn default() -> Self {
890 Self::DEFAULT
891 }
892}
893bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
894impl GimbalDeviceCapFlags {
895 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
896}
897impl Default for GimbalDeviceCapFlags {
898 fn default() -> Self {
899 Self::DEFAULT
900 }
901}
902bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
903impl GimbalDeviceErrorFlags {
904 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
905}
906impl Default for GimbalDeviceErrorFlags {
907 fn default() -> Self {
908 Self::DEFAULT
909 }
910}
911bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
912impl GimbalDeviceFlags {
913 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
914}
915impl Default for GimbalDeviceFlags {
916 fn default() -> Self {
917 Self::DEFAULT
918 }
919}
920bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
921impl GimbalManagerCapFlags {
922 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
923}
924impl Default for GimbalManagerCapFlags {
925 fn default() -> Self {
926 Self::DEFAULT
927 }
928}
929bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
930impl GimbalManagerFlags {
931 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
932}
933impl Default for GimbalManagerFlags {
934 fn default() -> Self {
935 Self::DEFAULT
936 }
937}
938#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
939#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
940#[cfg_attr(feature = "serde", serde(tag = "type"))]
941#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
942#[repr(u32)]
943#[doc = "Type of GPS fix"]
944pub enum GpsFixType {
945 #[doc = "No GPS connected"]
946 GPS_FIX_TYPE_NO_GPS = 0,
947 #[doc = "No position information, GPS is connected"]
948 GPS_FIX_TYPE_NO_FIX = 1,
949 #[doc = "2D position"]
950 GPS_FIX_TYPE_2D_FIX = 2,
951 #[doc = "3D position"]
952 GPS_FIX_TYPE_3D_FIX = 3,
953 #[doc = "DGPS/SBAS aided 3D position"]
954 GPS_FIX_TYPE_DGPS = 4,
955 #[doc = "RTK float, 3D position"]
956 GPS_FIX_TYPE_RTK_FLOAT = 5,
957 #[doc = "RTK Fixed, 3D position"]
958 GPS_FIX_TYPE_RTK_FIXED = 6,
959 #[doc = "Static fixed, typically used for base stations"]
960 GPS_FIX_TYPE_STATIC = 7,
961 #[doc = "PPP, 3D position."]
962 GPS_FIX_TYPE_PPP = 8,
963}
964impl GpsFixType {
965 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
966}
967impl Default for GpsFixType {
968 fn default() -> Self {
969 Self::DEFAULT
970 }
971}
972bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
973impl GpsInputIgnoreFlags {
974 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
975}
976impl Default for GpsInputIgnoreFlags {
977 fn default() -> Self {
978 Self::DEFAULT
979 }
980}
981#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
982#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
983#[cfg_attr(feature = "serde", serde(tag = "type"))]
984#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
985#[repr(u32)]
986#[doc = "Gripper actions."]
987pub enum GripperActions {
988 #[doc = "Gripper release cargo."]
989 GRIPPER_ACTION_RELEASE = 0,
990 #[doc = "Gripper grab onto cargo."]
991 GRIPPER_ACTION_GRAB = 1,
992}
993impl GripperActions {
994 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
995}
996impl Default for GripperActions {
997 fn default() -> Self {
998 Self::DEFAULT
999 }
1000}
1001bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1002impl HighresImuUpdatedFlags {
1003 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1004}
1005impl Default for HighresImuUpdatedFlags {
1006 fn default() -> Self {
1007 Self::DEFAULT
1008 }
1009}
1010bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1011impl HilActuatorControlsFlags {
1012 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1013}
1014impl Default for HilActuatorControlsFlags {
1015 fn default() -> Self {
1016 Self::DEFAULT
1017 }
1018}
1019bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1020impl HilSensorUpdatedFlags {
1021 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1022}
1023impl Default for HilSensorUpdatedFlags {
1024 fn default() -> Self {
1025 Self::DEFAULT
1026 }
1027}
1028bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1029impl HlFailureFlag {
1030 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1031}
1032impl Default for HlFailureFlag {
1033 fn default() -> Self {
1034 Self::DEFAULT
1035 }
1036}
1037bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1038impl IlluminatorErrorFlags {
1039 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1040}
1041impl Default for IlluminatorErrorFlags {
1042 fn default() -> Self {
1043 Self::DEFAULT
1044 }
1045}
1046#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1048#[cfg_attr(feature = "serde", serde(tag = "type"))]
1049#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1050#[repr(u32)]
1051#[doc = "Modes of illuminator"]
1052pub enum IlluminatorMode {
1053 #[doc = "Illuminator mode is not specified/unknown"]
1054 ILLUMINATOR_MODE_UNKNOWN = 0,
1055 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1056 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1057 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1058 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1059}
1060impl IlluminatorMode {
1061 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1062}
1063impl Default for IlluminatorMode {
1064 fn default() -> Self {
1065 Self::DEFAULT
1066 }
1067}
1068#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1069#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1070#[cfg_attr(feature = "serde", serde(tag = "type"))]
1071#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1072#[repr(u32)]
1073#[doc = "Type of landing target"]
1074pub enum LandingTargetType {
1075 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1076 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1077 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1078 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1079 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1080 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1081 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1082 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1083}
1084impl LandingTargetType {
1085 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1086}
1087impl Default for LandingTargetType {
1088 fn default() -> Self {
1089 Self::DEFAULT
1090 }
1091}
1092#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1093#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1094#[cfg_attr(feature = "serde", serde(tag = "type"))]
1095#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1096#[repr(u32)]
1097pub enum MagCalStatus {
1098 MAG_CAL_NOT_STARTED = 0,
1099 MAG_CAL_WAITING_TO_START = 1,
1100 MAG_CAL_RUNNING_STEP_ONE = 2,
1101 MAG_CAL_RUNNING_STEP_TWO = 3,
1102 MAG_CAL_SUCCESS = 4,
1103 MAG_CAL_FAILED = 5,
1104 MAG_CAL_BAD_ORIENTATION = 6,
1105 MAG_CAL_BAD_RADIUS = 7,
1106}
1107impl MagCalStatus {
1108 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1109}
1110impl Default for MagCalStatus {
1111 fn default() -> Self {
1112 Self::DEFAULT
1113 }
1114}
1115#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1116#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1117#[cfg_attr(feature = "serde", serde(tag = "type"))]
1118#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1119#[repr(u32)]
1120pub enum MavArmAuthDeniedReason {
1121 #[doc = "Not a specific reason"]
1122 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1123 #[doc = "Authorizer will send the error as string to GCS"]
1124 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1125 #[doc = "At least one waypoint have a invalid value"]
1126 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1127 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1128 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1129 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1130 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1131 #[doc = "Weather is not good to fly"]
1132 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1133}
1134impl MavArmAuthDeniedReason {
1135 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1136}
1137impl Default for MavArmAuthDeniedReason {
1138 fn default() -> Self {
1139 Self::DEFAULT
1140 }
1141}
1142#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1143#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1144#[cfg_attr(feature = "serde", serde(tag = "type"))]
1145#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1146#[repr(u32)]
1147#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1148pub enum MavAutopilot {
1149 #[doc = "Generic autopilot, full support for everything"]
1150 MAV_AUTOPILOT_GENERIC = 0,
1151 #[doc = "Reserved for future use."]
1152 MAV_AUTOPILOT_RESERVED = 1,
1153 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1154 MAV_AUTOPILOT_SLUGS = 2,
1155 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1156 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1157 #[doc = "OpenPilot, <http://openpilot.org>"]
1158 MAV_AUTOPILOT_OPENPILOT = 4,
1159 #[doc = "Generic autopilot only supporting simple waypoints"]
1160 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1161 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1162 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1163 #[doc = "Generic autopilot supporting the full mission command set"]
1164 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1165 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1166 MAV_AUTOPILOT_INVALID = 8,
1167 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1168 MAV_AUTOPILOT_PPZ = 9,
1169 #[doc = "UAV Dev Board"]
1170 MAV_AUTOPILOT_UDB = 10,
1171 #[doc = "FlexiPilot"]
1172 MAV_AUTOPILOT_FP = 11,
1173 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1174 MAV_AUTOPILOT_PX4 = 12,
1175 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1176 MAV_AUTOPILOT_SMACCMPILOT = 13,
1177 #[doc = "AutoQuad -- <http://autoquad.org>"]
1178 MAV_AUTOPILOT_AUTOQUAD = 14,
1179 #[doc = "Armazila -- <http://armazila.com>"]
1180 MAV_AUTOPILOT_ARMAZILA = 15,
1181 #[doc = "Aerob -- <http://aerob.ru>"]
1182 MAV_AUTOPILOT_AEROB = 16,
1183 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1184 MAV_AUTOPILOT_ASLUAV = 17,
1185 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1186 MAV_AUTOPILOT_SMARTAP = 18,
1187 #[doc = "AirRails - <http://uaventure.com>"]
1188 MAV_AUTOPILOT_AIRRAILS = 19,
1189 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1190 MAV_AUTOPILOT_REFLEX = 20,
1191}
1192impl MavAutopilot {
1193 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1194}
1195impl Default for MavAutopilot {
1196 fn default() -> Self {
1197 Self::DEFAULT
1198 }
1199}
1200#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1201#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1202#[cfg_attr(feature = "serde", serde(tag = "type"))]
1203#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1204#[repr(u32)]
1205#[doc = "Enumeration for battery charge states."]
1206pub enum MavBatteryChargeState {
1207 #[doc = "Low battery state is not provided"]
1208 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1209 #[doc = "Battery is not in low state. Normal operation."]
1210 MAV_BATTERY_CHARGE_STATE_OK = 1,
1211 #[doc = "Battery state is low, warn and monitor close."]
1212 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1213 #[doc = "Battery state is critical, return or abort immediately."]
1214 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1215 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1216 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1217 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1218 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1219 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1220 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1221 #[doc = "Battery is charging."]
1222 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1223}
1224impl MavBatteryChargeState {
1225 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1226}
1227impl Default for MavBatteryChargeState {
1228 fn default() -> Self {
1229 Self::DEFAULT
1230 }
1231}
1232bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1233impl MavBatteryFault {
1234 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1235}
1236impl Default for MavBatteryFault {
1237 fn default() -> Self {
1238 Self::DEFAULT
1239 }
1240}
1241#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1242#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1243#[cfg_attr(feature = "serde", serde(tag = "type"))]
1244#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1245#[repr(u32)]
1246#[doc = "Enumeration of battery functions"]
1247pub enum MavBatteryFunction {
1248 #[doc = "Battery function is unknown"]
1249 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1250 #[doc = "Battery supports all flight systems"]
1251 MAV_BATTERY_FUNCTION_ALL = 1,
1252 #[doc = "Battery for the propulsion system"]
1253 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1254 #[doc = "Avionics battery"]
1255 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1256 #[doc = "Payload battery"]
1257 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1258}
1259impl MavBatteryFunction {
1260 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1261}
1262impl Default for MavBatteryFunction {
1263 fn default() -> Self {
1264 Self::DEFAULT
1265 }
1266}
1267#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1269#[cfg_attr(feature = "serde", serde(tag = "type"))]
1270#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1271#[repr(u32)]
1272#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1273pub enum MavBatteryMode {
1274 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1275 MAV_BATTERY_MODE_UNKNOWN = 0,
1276 #[doc = "Battery is auto discharging (towards storage level)."]
1277 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1278 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1279 MAV_BATTERY_MODE_HOT_SWAP = 2,
1280}
1281impl MavBatteryMode {
1282 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1283}
1284impl Default for MavBatteryMode {
1285 fn default() -> Self {
1286 Self::DEFAULT
1287 }
1288}
1289#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1290#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1291#[cfg_attr(feature = "serde", serde(tag = "type"))]
1292#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1293#[repr(u32)]
1294#[doc = "Enumeration of battery types"]
1295pub enum MavBatteryType {
1296 #[doc = "Not specified."]
1297 MAV_BATTERY_TYPE_UNKNOWN = 0,
1298 #[doc = "Lithium polymer battery"]
1299 MAV_BATTERY_TYPE_LIPO = 1,
1300 #[doc = "Lithium-iron-phosphate battery"]
1301 MAV_BATTERY_TYPE_LIFE = 2,
1302 #[doc = "Lithium-ION battery"]
1303 MAV_BATTERY_TYPE_LION = 3,
1304 #[doc = "Nickel metal hydride battery"]
1305 MAV_BATTERY_TYPE_NIMH = 4,
1306}
1307impl MavBatteryType {
1308 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1309}
1310impl Default for MavBatteryType {
1311 fn default() -> Self {
1312 Self::DEFAULT
1313 }
1314}
1315#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1317#[cfg_attr(feature = "serde", serde(tag = "type"))]
1318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1319#[repr(u32)]
1320#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1321pub enum MavCmd {
1322 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1323 MAV_CMD_NAV_WAYPOINT = 16,
1324 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1325 MAV_CMD_NAV_LOITER_UNLIM = 17,
1326 #[doc = "Loiter around this waypoint for X turns"]
1327 MAV_CMD_NAV_LOITER_TURNS = 18,
1328 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1329 MAV_CMD_NAV_LOITER_TIME = 19,
1330 #[doc = "Return to launch location"]
1331 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1332 #[doc = "Land at location."]
1333 MAV_CMD_NAV_LAND = 21,
1334 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1335 MAV_CMD_NAV_TAKEOFF = 22,
1336 #[doc = "Land at local position (local frame only)"]
1337 MAV_CMD_NAV_LAND_LOCAL = 23,
1338 #[doc = "Takeoff from local position (local frame only)"]
1339 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1340 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1341 MAV_CMD_NAV_FOLLOW = 25,
1342 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1343 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1344 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1345 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1346 #[doc = "Begin following a target"]
1347 MAV_CMD_DO_FOLLOW = 32,
1348 #[doc = "Reposition the MAV after a follow target command has been sent"]
1349 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1350 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1351 MAV_CMD_DO_ORBIT = 34,
1352 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1353 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1354 MAV_CMD_NAV_ROI = 80,
1355 #[doc = "Control autonomous path planning on the MAV."]
1356 MAV_CMD_NAV_PATHPLANNING = 81,
1357 #[doc = "Navigate to waypoint using a spline path."]
1358 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1359 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1360 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1361 #[doc = "Land using VTOL mode"]
1362 MAV_CMD_NAV_VTOL_LAND = 85,
1363 #[doc = "hand control over to an external controller"]
1364 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1365 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1366 MAV_CMD_NAV_DELAY = 93,
1367 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1368 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1369 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1370 MAV_CMD_NAV_LAST = 95,
1371 #[doc = "Delay mission state machine."]
1372 MAV_CMD_CONDITION_DELAY = 112,
1373 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1374 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1375 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1376 MAV_CMD_CONDITION_DISTANCE = 114,
1377 #[doc = "Reach a certain target angle."]
1378 MAV_CMD_CONDITION_YAW = 115,
1379 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1380 MAV_CMD_CONDITION_LAST = 159,
1381 #[doc = "Set system mode."]
1382 MAV_CMD_DO_SET_MODE = 176,
1383 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1384 MAV_CMD_DO_JUMP = 177,
1385 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1386 MAV_CMD_DO_CHANGE_SPEED = 178,
1387 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1388 MAV_CMD_DO_SET_HOME = 179,
1389 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1390 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1391 MAV_CMD_DO_SET_PARAMETER = 180,
1392 #[doc = "Set a relay to a condition."]
1393 MAV_CMD_DO_SET_RELAY = 181,
1394 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1395 MAV_CMD_DO_REPEAT_RELAY = 182,
1396 #[doc = "Set a servo to a desired PWM value."]
1397 MAV_CMD_DO_SET_SERVO = 183,
1398 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1399 MAV_CMD_DO_REPEAT_SERVO = 184,
1400 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1401 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1402 #[doc = "Change altitude set point."]
1403 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1404 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1405 MAV_CMD_DO_SET_ACTUATOR = 187,
1406 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1407 MAV_CMD_DO_RETURN_PATH_START = 188,
1408 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1409 MAV_CMD_DO_LAND_START = 189,
1410 #[doc = "Mission command to perform a landing from a rally point."]
1411 MAV_CMD_DO_RALLY_LAND = 190,
1412 #[doc = "Mission command to safely abort an autonomous landing."]
1413 MAV_CMD_DO_GO_AROUND = 191,
1414 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1415 MAV_CMD_DO_REPOSITION = 192,
1416 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1417 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1418 #[doc = "Set moving direction to forward or reverse."]
1419 MAV_CMD_DO_SET_REVERSE = 194,
1420 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1421 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1422 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1423 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1424 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1425 MAV_CMD_DO_SET_ROI_NONE = 197,
1426 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1427 MAV_CMD_DO_SET_ROI_SYSID = 198,
1428 #[doc = "Control onboard camera system."]
1429 MAV_CMD_DO_CONTROL_VIDEO = 200,
1430 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1431 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1432 MAV_CMD_DO_SET_ROI = 201,
1433 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1434 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1435 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1436 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1437 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1438 #[doc = "Mission command to configure a camera or antenna mount"]
1439 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1440 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1441 #[doc = "Mission command to control a camera or antenna mount"]
1442 MAV_CMD_DO_MOUNT_CONTROL = 205,
1443 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1444 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1445 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1446 MAV_CMD_DO_FENCE_ENABLE = 207,
1447 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1448 MAV_CMD_DO_PARACHUTE = 208,
1449 #[doc = "Command to perform motor test."]
1450 MAV_CMD_DO_MOTOR_TEST = 209,
1451 #[doc = "Change to/from inverted flight."]
1452 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1453 #[doc = "Mission command to operate a gripper."]
1454 MAV_CMD_DO_GRIPPER = 211,
1455 #[doc = "Enable/disable autotune."]
1456 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1457 #[doc = "Sets a desired vehicle turn angle and speed change."]
1458 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1459 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1460 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1461 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1462 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1463 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1464 #[doc = "set id of master controller"]
1465 MAV_CMD_DO_GUIDED_MASTER = 221,
1466 #[doc = "Set limits for external control"]
1467 MAV_CMD_DO_GUIDED_LIMITS = 222,
1468 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1469 MAV_CMD_DO_ENGINE_CONTROL = 223,
1470 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1471 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1472 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1473 MAV_CMD_DO_LAST = 240,
1474 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1475 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1476 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1477 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1478 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1479 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1480 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1481 MAV_CMD_PREFLIGHT_STORAGE = 245,
1482 #[doc = "Request the reboot or shutdown of system components."]
1483 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1484 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1485 MAV_CMD_OVERRIDE_GOTO = 252,
1486 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1487 MAV_CMD_OBLIQUE_SURVEY = 260,
1488 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1489 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1490 #[doc = "start running a mission"]
1491 MAV_CMD_MISSION_START = 300,
1492 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1493 MAV_CMD_ACTUATOR_TEST = 310,
1494 #[doc = "Actuator configuration command."]
1495 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1496 #[doc = "Arms / Disarms a component"]
1497 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1498 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1499 MAV_CMD_RUN_PREARM_CHECKS = 401,
1500 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1501 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1502 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1503 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1504 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1505 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1506 MAV_CMD_GET_HOME_POSITION = 410,
1507 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1508 MAV_CMD_INJECT_FAILURE = 420,
1509 #[doc = "Starts receiver pairing."]
1510 MAV_CMD_START_RX_PAIR = 500,
1511 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1512 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1513 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1514 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1515 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1516 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1517 MAV_CMD_REQUEST_MESSAGE = 512,
1518 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1519 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1520 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1521 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1522 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1523 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1524 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1525 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1526 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1527 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1528 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1529 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1530 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1531 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1532 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1533 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1534 MAV_CMD_STORAGE_FORMAT = 526,
1535 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1536 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1537 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1538 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1539 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1540 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1541 #[doc = "Reset all camera settings to Factory Default"]
1542 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1543 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1544 MAV_CMD_SET_CAMERA_MODE = 530,
1545 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1546 MAV_CMD_SET_CAMERA_ZOOM = 531,
1547 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1548 MAV_CMD_SET_CAMERA_FOCUS = 532,
1549 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1550 MAV_CMD_SET_STORAGE_USAGE = 533,
1551 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1552 MAV_CMD_SET_CAMERA_SOURCE = 534,
1553 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1554 MAV_CMD_JUMP_TAG = 600,
1555 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1556 MAV_CMD_DO_JUMP_TAG = 601,
1557 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1558 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1559 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1560 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1561 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1562 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1563 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1564 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1565 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1566 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1567 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1568 #[doc = "Enable or disable on-board camera triggering system."]
1569 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1570 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1571 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1572 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1573 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1574 #[doc = "Stops ongoing tracking."]
1575 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1576 #[doc = "Starts video capture (recording)."]
1577 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1578 #[doc = "Stop the current video capture (recording)."]
1579 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1580 #[doc = "Start video streaming"]
1581 MAV_CMD_VIDEO_START_STREAMING = 2502,
1582 #[doc = "Stop the given video stream"]
1583 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1584 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1585 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1586 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1587 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1588 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1589 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1590 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1591 MAV_CMD_LOGGING_START = 2510,
1592 #[doc = "Request to stop streaming log data over MAVLink"]
1593 MAV_CMD_LOGGING_STOP = 2511,
1594 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1595 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1596 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1597 #[doc = "Create a panorama at the current position"]
1598 MAV_CMD_PANORAMA_CREATE = 2800,
1599 #[doc = "Request VTOL transition"]
1600 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1601 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1602 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1603 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1604 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1605 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1606 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1607 #[doc = "Delay mission state machine until gate has been reached."]
1608 MAV_CMD_CONDITION_GATE = 4501,
1609 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1610 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1611 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1612 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1613 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1614 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1615 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1616 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1617 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1618 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1619 #[doc = "Rally point. You can have multiple rally points defined."]
1620 MAV_CMD_NAV_RALLY_POINT = 5100,
1621 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1622 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1623 #[doc = "Change state of safety switch."]
1624 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1625 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1626 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1627 #[deprecated = " (Deprecated since 2021-06)"]
1628 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1629 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1630 #[deprecated = " (Deprecated since 2021-06)"]
1631 #[doc = "Control the payload deployment."]
1632 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1633 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1634 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1635 #[doc = "Command to operate winch."]
1636 MAV_CMD_DO_WINCH = 42600,
1637 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1638 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1639 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1640 MAV_CMD_WAYPOINT_USER_1 = 31000,
1641 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1642 MAV_CMD_WAYPOINT_USER_2 = 31001,
1643 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1644 MAV_CMD_WAYPOINT_USER_3 = 31002,
1645 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1646 MAV_CMD_WAYPOINT_USER_4 = 31003,
1647 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1648 MAV_CMD_WAYPOINT_USER_5 = 31004,
1649 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1650 MAV_CMD_SPATIAL_USER_1 = 31005,
1651 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1652 MAV_CMD_SPATIAL_USER_2 = 31006,
1653 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1654 MAV_CMD_SPATIAL_USER_3 = 31007,
1655 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1656 MAV_CMD_SPATIAL_USER_4 = 31008,
1657 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1658 MAV_CMD_SPATIAL_USER_5 = 31009,
1659 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1660 MAV_CMD_USER_1 = 31010,
1661 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1662 MAV_CMD_USER_2 = 31011,
1663 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1664 MAV_CMD_USER_3 = 31012,
1665 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1666 MAV_CMD_USER_4 = 31013,
1667 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1668 MAV_CMD_USER_5 = 31014,
1669 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1670 MAV_CMD_CAN_FORWARD = 32000,
1671}
1672impl MavCmd {
1673 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1674}
1675impl Default for MavCmd {
1676 fn default() -> Self {
1677 Self::DEFAULT
1678 }
1679}
1680#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1681#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1682#[cfg_attr(feature = "serde", serde(tag = "type"))]
1683#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1684#[repr(u32)]
1685#[doc = "Possible actions an aircraft can take to avoid a collision."]
1686pub enum MavCollisionAction {
1687 #[doc = "Ignore any potential collisions"]
1688 MAV_COLLISION_ACTION_NONE = 0,
1689 #[doc = "Report potential collision"]
1690 MAV_COLLISION_ACTION_REPORT = 1,
1691 #[doc = "Ascend or Descend to avoid threat"]
1692 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1693 #[doc = "Move horizontally to avoid threat"]
1694 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1695 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1696 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1697 #[doc = "Aircraft to fly directly back to its launch point"]
1698 MAV_COLLISION_ACTION_RTL = 5,
1699 #[doc = "Aircraft to stop in place"]
1700 MAV_COLLISION_ACTION_HOVER = 6,
1701}
1702impl MavCollisionAction {
1703 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1704}
1705impl Default for MavCollisionAction {
1706 fn default() -> Self {
1707 Self::DEFAULT
1708 }
1709}
1710#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1711#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1712#[cfg_attr(feature = "serde", serde(tag = "type"))]
1713#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1714#[repr(u32)]
1715#[doc = "Source of information about this collision."]
1716pub enum MavCollisionSrc {
1717 #[doc = "ID field references ADSB_VEHICLE packets"]
1718 MAV_COLLISION_SRC_ADSB = 0,
1719 #[doc = "ID field references MAVLink SRC ID"]
1720 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1721}
1722impl MavCollisionSrc {
1723 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1724}
1725impl Default for MavCollisionSrc {
1726 fn default() -> Self {
1727 Self::DEFAULT
1728 }
1729}
1730#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1732#[cfg_attr(feature = "serde", serde(tag = "type"))]
1733#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1734#[repr(u32)]
1735#[doc = "Aircraft-rated danger from this threat."]
1736pub enum MavCollisionThreatLevel {
1737 #[doc = "Not a threat"]
1738 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1739 #[doc = "Craft is mildly concerned about this threat"]
1740 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1741 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1742 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1743}
1744impl MavCollisionThreatLevel {
1745 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1746}
1747impl Default for MavCollisionThreatLevel {
1748 fn default() -> Self {
1749 Self::DEFAULT
1750 }
1751}
1752#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1753#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1754#[cfg_attr(feature = "serde", serde(tag = "type"))]
1755#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1756#[repr(u32)]
1757#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1758pub enum MavComponent {
1759 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1760 MAV_COMP_ID_ALL = 0,
1761 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1762 MAV_COMP_ID_AUTOPILOT1 = 1,
1763 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1764 MAV_COMP_ID_USER1 = 25,
1765 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1766 MAV_COMP_ID_USER2 = 26,
1767 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1768 MAV_COMP_ID_USER3 = 27,
1769 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1770 MAV_COMP_ID_USER4 = 28,
1771 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1772 MAV_COMP_ID_USER5 = 29,
1773 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1774 MAV_COMP_ID_USER6 = 30,
1775 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1776 MAV_COMP_ID_USER7 = 31,
1777 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1778 MAV_COMP_ID_USER8 = 32,
1779 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1780 MAV_COMP_ID_USER9 = 33,
1781 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1782 MAV_COMP_ID_USER10 = 34,
1783 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1784 MAV_COMP_ID_USER11 = 35,
1785 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1786 MAV_COMP_ID_USER12 = 36,
1787 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1788 MAV_COMP_ID_USER13 = 37,
1789 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1790 MAV_COMP_ID_USER14 = 38,
1791 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1792 MAV_COMP_ID_USER15 = 39,
1793 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1794 MAV_COMP_ID_USER16 = 40,
1795 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1796 MAV_COMP_ID_USER17 = 41,
1797 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1798 MAV_COMP_ID_USER18 = 42,
1799 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1800 MAV_COMP_ID_USER19 = 43,
1801 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1802 MAV_COMP_ID_USER20 = 44,
1803 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1804 MAV_COMP_ID_USER21 = 45,
1805 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1806 MAV_COMP_ID_USER22 = 46,
1807 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1808 MAV_COMP_ID_USER23 = 47,
1809 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1810 MAV_COMP_ID_USER24 = 48,
1811 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1812 MAV_COMP_ID_USER25 = 49,
1813 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1814 MAV_COMP_ID_USER26 = 50,
1815 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1816 MAV_COMP_ID_USER27 = 51,
1817 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1818 MAV_COMP_ID_USER28 = 52,
1819 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1820 MAV_COMP_ID_USER29 = 53,
1821 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1822 MAV_COMP_ID_USER30 = 54,
1823 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1824 MAV_COMP_ID_USER31 = 55,
1825 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1826 MAV_COMP_ID_USER32 = 56,
1827 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1828 MAV_COMP_ID_USER33 = 57,
1829 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1830 MAV_COMP_ID_USER34 = 58,
1831 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1832 MAV_COMP_ID_USER35 = 59,
1833 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1834 MAV_COMP_ID_USER36 = 60,
1835 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1836 MAV_COMP_ID_USER37 = 61,
1837 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1838 MAV_COMP_ID_USER38 = 62,
1839 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1840 MAV_COMP_ID_USER39 = 63,
1841 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1842 MAV_COMP_ID_USER40 = 64,
1843 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1844 MAV_COMP_ID_USER41 = 65,
1845 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1846 MAV_COMP_ID_USER42 = 66,
1847 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1848 MAV_COMP_ID_USER43 = 67,
1849 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1850 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1851 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1852 MAV_COMP_ID_USER45 = 69,
1853 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1854 MAV_COMP_ID_USER46 = 70,
1855 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1856 MAV_COMP_ID_USER47 = 71,
1857 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1858 MAV_COMP_ID_USER48 = 72,
1859 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1860 MAV_COMP_ID_USER49 = 73,
1861 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1862 MAV_COMP_ID_USER50 = 74,
1863 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1864 MAV_COMP_ID_USER51 = 75,
1865 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1866 MAV_COMP_ID_USER52 = 76,
1867 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1868 MAV_COMP_ID_USER53 = 77,
1869 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1870 MAV_COMP_ID_USER54 = 78,
1871 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1872 MAV_COMP_ID_USER55 = 79,
1873 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1874 MAV_COMP_ID_USER56 = 80,
1875 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1876 MAV_COMP_ID_USER57 = 81,
1877 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1878 MAV_COMP_ID_USER58 = 82,
1879 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1880 MAV_COMP_ID_USER59 = 83,
1881 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1882 MAV_COMP_ID_USER60 = 84,
1883 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1884 MAV_COMP_ID_USER61 = 85,
1885 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1886 MAV_COMP_ID_USER62 = 86,
1887 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1888 MAV_COMP_ID_USER63 = 87,
1889 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1890 MAV_COMP_ID_USER64 = 88,
1891 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1892 MAV_COMP_ID_USER65 = 89,
1893 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1894 MAV_COMP_ID_USER66 = 90,
1895 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1896 MAV_COMP_ID_USER67 = 91,
1897 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1898 MAV_COMP_ID_USER68 = 92,
1899 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1900 MAV_COMP_ID_USER69 = 93,
1901 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1902 MAV_COMP_ID_USER70 = 94,
1903 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1904 MAV_COMP_ID_USER71 = 95,
1905 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1906 MAV_COMP_ID_USER72 = 96,
1907 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1908 MAV_COMP_ID_USER73 = 97,
1909 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1910 MAV_COMP_ID_USER74 = 98,
1911 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1912 MAV_COMP_ID_USER75 = 99,
1913 #[doc = "Camera #1."]
1914 MAV_COMP_ID_CAMERA = 100,
1915 #[doc = "Camera #2."]
1916 MAV_COMP_ID_CAMERA2 = 101,
1917 #[doc = "Camera #3."]
1918 MAV_COMP_ID_CAMERA3 = 102,
1919 #[doc = "Camera #4."]
1920 MAV_COMP_ID_CAMERA4 = 103,
1921 #[doc = "Camera #5."]
1922 MAV_COMP_ID_CAMERA5 = 104,
1923 #[doc = "Camera #6."]
1924 MAV_COMP_ID_CAMERA6 = 105,
1925 #[doc = "Servo #1."]
1926 MAV_COMP_ID_SERVO1 = 140,
1927 #[doc = "Servo #2."]
1928 MAV_COMP_ID_SERVO2 = 141,
1929 #[doc = "Servo #3."]
1930 MAV_COMP_ID_SERVO3 = 142,
1931 #[doc = "Servo #4."]
1932 MAV_COMP_ID_SERVO4 = 143,
1933 #[doc = "Servo #5."]
1934 MAV_COMP_ID_SERVO5 = 144,
1935 #[doc = "Servo #6."]
1936 MAV_COMP_ID_SERVO6 = 145,
1937 #[doc = "Servo #7."]
1938 MAV_COMP_ID_SERVO7 = 146,
1939 #[doc = "Servo #8."]
1940 MAV_COMP_ID_SERVO8 = 147,
1941 #[doc = "Servo #9."]
1942 MAV_COMP_ID_SERVO9 = 148,
1943 #[doc = "Servo #10."]
1944 MAV_COMP_ID_SERVO10 = 149,
1945 #[doc = "Servo #11."]
1946 MAV_COMP_ID_SERVO11 = 150,
1947 #[doc = "Servo #12."]
1948 MAV_COMP_ID_SERVO12 = 151,
1949 #[doc = "Servo #13."]
1950 MAV_COMP_ID_SERVO13 = 152,
1951 #[doc = "Servo #14."]
1952 MAV_COMP_ID_SERVO14 = 153,
1953 #[doc = "Gimbal #1."]
1954 MAV_COMP_ID_GIMBAL = 154,
1955 #[doc = "Logging component."]
1956 MAV_COMP_ID_LOG = 155,
1957 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
1958 MAV_COMP_ID_ADSB = 156,
1959 #[doc = "On Screen Display (OSD) devices for video links."]
1960 MAV_COMP_ID_OSD = 157,
1961 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
1962 MAV_COMP_ID_PERIPHERAL = 158,
1963 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
1964 #[doc = "Gimbal ID for QX1."]
1965 MAV_COMP_ID_QX1_GIMBAL = 159,
1966 #[doc = "FLARM collision alert component."]
1967 MAV_COMP_ID_FLARM = 160,
1968 #[doc = "Parachute component."]
1969 MAV_COMP_ID_PARACHUTE = 161,
1970 #[doc = "Winch component."]
1971 MAV_COMP_ID_WINCH = 169,
1972 #[doc = "Gimbal #2."]
1973 MAV_COMP_ID_GIMBAL2 = 171,
1974 #[doc = "Gimbal #3."]
1975 MAV_COMP_ID_GIMBAL3 = 172,
1976 #[doc = "Gimbal #4"]
1977 MAV_COMP_ID_GIMBAL4 = 173,
1978 #[doc = "Gimbal #5."]
1979 MAV_COMP_ID_GIMBAL5 = 174,
1980 #[doc = "Gimbal #6."]
1981 MAV_COMP_ID_GIMBAL6 = 175,
1982 #[doc = "Battery #1."]
1983 MAV_COMP_ID_BATTERY = 180,
1984 #[doc = "Battery #2."]
1985 MAV_COMP_ID_BATTERY2 = 181,
1986 #[doc = "CAN over MAVLink client."]
1987 MAV_COMP_ID_MAVCAN = 189,
1988 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
1989 MAV_COMP_ID_MISSIONPLANNER = 190,
1990 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1991 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
1992 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1993 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
1994 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1995 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
1996 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1997 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
1998 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
1999 MAV_COMP_ID_PATHPLANNER = 195,
2000 #[doc = "Component that plans a collision free path between two points."]
2001 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2002 #[doc = "Component that provides position estimates using VIO techniques."]
2003 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2004 #[doc = "Component that manages pairing of vehicle and GCS."]
2005 MAV_COMP_ID_PAIRING_MANAGER = 198,
2006 #[doc = "Inertial Measurement Unit (IMU) #1."]
2007 MAV_COMP_ID_IMU = 200,
2008 #[doc = "Inertial Measurement Unit (IMU) #2."]
2009 MAV_COMP_ID_IMU_2 = 201,
2010 #[doc = "Inertial Measurement Unit (IMU) #3."]
2011 MAV_COMP_ID_IMU_3 = 202,
2012 #[doc = "GPS #1."]
2013 MAV_COMP_ID_GPS = 220,
2014 #[doc = "GPS #2."]
2015 MAV_COMP_ID_GPS2 = 221,
2016 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2017 MAV_COMP_ID_ODID_TXRX_1 = 236,
2018 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2019 MAV_COMP_ID_ODID_TXRX_2 = 237,
2020 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2021 MAV_COMP_ID_ODID_TXRX_3 = 238,
2022 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2023 MAV_COMP_ID_UDP_BRIDGE = 240,
2024 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2025 MAV_COMP_ID_UART_BRIDGE = 241,
2026 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2027 MAV_COMP_ID_TUNNEL_NODE = 242,
2028 #[doc = "Illuminator"]
2029 MAV_COMP_ID_ILLUMINATOR = 243,
2030 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2031 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2032 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2033}
2034impl MavComponent {
2035 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2036}
2037impl Default for MavComponent {
2038 fn default() -> Self {
2039 Self::DEFAULT
2040 }
2041}
2042#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2043#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2044#[cfg_attr(feature = "serde", serde(tag = "type"))]
2045#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2046#[repr(u32)]
2047#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2048#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2049pub enum MavDataStream {
2050 #[doc = "Enable all data streams"]
2051 MAV_DATA_STREAM_ALL = 0,
2052 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2053 MAV_DATA_STREAM_RAW_SENSORS = 1,
2054 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2055 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2056 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2057 MAV_DATA_STREAM_RC_CHANNELS = 3,
2058 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2059 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2060 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2061 MAV_DATA_STREAM_POSITION = 6,
2062 #[doc = "Dependent on the autopilot"]
2063 MAV_DATA_STREAM_EXTRA1 = 10,
2064 #[doc = "Dependent on the autopilot"]
2065 MAV_DATA_STREAM_EXTRA2 = 11,
2066 #[doc = "Dependent on the autopilot"]
2067 MAV_DATA_STREAM_EXTRA3 = 12,
2068}
2069impl MavDataStream {
2070 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2071}
2072impl Default for MavDataStream {
2073 fn default() -> Self {
2074 Self::DEFAULT
2075 }
2076}
2077#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2078#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2079#[cfg_attr(feature = "serde", serde(tag = "type"))]
2080#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2081#[repr(u32)]
2082#[doc = "Enumeration of distance sensor types"]
2083pub enum MavDistanceSensor {
2084 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2085 MAV_DISTANCE_SENSOR_LASER = 0,
2086 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2087 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2088 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2089 MAV_DISTANCE_SENSOR_INFRARED = 2,
2090 #[doc = "Radar type, e.g. uLanding units"]
2091 MAV_DISTANCE_SENSOR_RADAR = 3,
2092 #[doc = "Broken or unknown type, e.g. analog units"]
2093 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2094}
2095impl MavDistanceSensor {
2096 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2097}
2098impl Default for MavDistanceSensor {
2099 fn default() -> Self {
2100 Self::DEFAULT
2101 }
2102}
2103#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2105#[cfg_attr(feature = "serde", serde(tag = "type"))]
2106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2107#[repr(u32)]
2108#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2109pub enum MavDoRepositionFlags {
2110 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2111 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2112}
2113impl MavDoRepositionFlags {
2114 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2115}
2116impl Default for MavDoRepositionFlags {
2117 fn default() -> Self {
2118 Self::DEFAULT
2119 }
2120}
2121#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2122#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2123#[cfg_attr(feature = "serde", serde(tag = "type"))]
2124#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2125#[repr(u32)]
2126#[doc = "Enumeration of estimator types"]
2127pub enum MavEstimatorType {
2128 #[doc = "Unknown type of the estimator."]
2129 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2130 #[doc = "This is a naive estimator without any real covariance feedback."]
2131 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2132 #[doc = "Computer vision based estimate. Might be up to scale."]
2133 MAV_ESTIMATOR_TYPE_VISION = 2,
2134 #[doc = "Visual-inertial estimate."]
2135 MAV_ESTIMATOR_TYPE_VIO = 3,
2136 #[doc = "Plain GPS estimate."]
2137 MAV_ESTIMATOR_TYPE_GPS = 4,
2138 #[doc = "Estimator integrating GPS and inertial sensing."]
2139 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2140 #[doc = "Estimate from external motion capturing system."]
2141 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2142 #[doc = "Estimator based on lidar sensor input."]
2143 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2144 #[doc = "Estimator on autopilot."]
2145 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2146}
2147impl MavEstimatorType {
2148 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2149}
2150impl Default for MavEstimatorType {
2151 fn default() -> Self {
2152 Self::DEFAULT
2153 }
2154}
2155#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2156#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2157#[cfg_attr(feature = "serde", serde(tag = "type"))]
2158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2159#[repr(u32)]
2160#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2161pub enum MavEventCurrentSequenceFlags {
2162 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2163 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2164}
2165impl MavEventCurrentSequenceFlags {
2166 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2167}
2168impl Default for MavEventCurrentSequenceFlags {
2169 fn default() -> Self {
2170 Self::DEFAULT
2171 }
2172}
2173#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2175#[cfg_attr(feature = "serde", serde(tag = "type"))]
2176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2177#[repr(u32)]
2178#[doc = "Reason for an event error response."]
2179pub enum MavEventErrorReason {
2180 #[doc = "The requested event is not available (anymore)."]
2181 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2182}
2183impl MavEventErrorReason {
2184 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2185}
2186impl Default for MavEventErrorReason {
2187 fn default() -> Self {
2188 Self::DEFAULT
2189 }
2190}
2191#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2192#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2193#[cfg_attr(feature = "serde", serde(tag = "type"))]
2194#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2195#[repr(u32)]
2196#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2197pub enum MavFrame {
2198 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2199 MAV_FRAME_GLOBAL = 0,
2200 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2201 MAV_FRAME_LOCAL_NED = 1,
2202 #[doc = "NOT a coordinate frame, indicates a mission command."]
2203 MAV_FRAME_MISSION = 2,
2204 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2205 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2206 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2207 MAV_FRAME_LOCAL_ENU = 4,
2208 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2209 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2210 MAV_FRAME_GLOBAL_INT = 5,
2211 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2212 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2213 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2214 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2215 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2216 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2217 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2218 MAV_FRAME_BODY_NED = 8,
2219 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2220 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2221 MAV_FRAME_BODY_OFFSET_NED = 9,
2222 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2223 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2224 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2225 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2226 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2227 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2228 MAV_FRAME_BODY_FRD = 12,
2229 #[deprecated = " (Deprecated since 2019-04)"]
2230 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2231 MAV_FRAME_RESERVED_13 = 13,
2232 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2233 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2234 MAV_FRAME_RESERVED_14 = 14,
2235 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2236 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2237 MAV_FRAME_RESERVED_15 = 15,
2238 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2239 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2240 MAV_FRAME_RESERVED_16 = 16,
2241 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2242 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2243 MAV_FRAME_RESERVED_17 = 17,
2244 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2245 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2246 MAV_FRAME_RESERVED_18 = 18,
2247 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2248 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2249 MAV_FRAME_RESERVED_19 = 19,
2250 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2251 MAV_FRAME_LOCAL_FRD = 20,
2252 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2253 MAV_FRAME_LOCAL_FLU = 21,
2254}
2255impl MavFrame {
2256 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2257}
2258impl Default for MavFrame {
2259 fn default() -> Self {
2260 Self::DEFAULT
2261 }
2262}
2263#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2264#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2265#[cfg_attr(feature = "serde", serde(tag = "type"))]
2266#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2267#[repr(u32)]
2268#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2269pub enum MavFtpErr {
2270 #[doc = "None: No error"]
2271 MAV_FTP_ERR_NONE = 0,
2272 #[doc = "Fail: Unknown failure"]
2273 MAV_FTP_ERR_FAIL = 1,
2274 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2275 MAV_FTP_ERR_FAILERRNO = 2,
2276 #[doc = "InvalidDataSize: Payload size is invalid"]
2277 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2278 #[doc = "InvalidSession: Session is not currently open"]
2279 MAV_FTP_ERR_INVALIDSESSION = 4,
2280 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2281 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2282 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2283 MAV_FTP_ERR_EOF = 6,
2284 #[doc = "UnknownCommand: Unknown command / opcode"]
2285 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2286 #[doc = "FileExists: File/directory already exists"]
2287 MAV_FTP_ERR_FILEEXISTS = 8,
2288 #[doc = "FileProtected: File/directory is write protected"]
2289 MAV_FTP_ERR_FILEPROTECTED = 9,
2290 #[doc = "FileNotFound: File/directory not found"]
2291 MAV_FTP_ERR_FILENOTFOUND = 10,
2292}
2293impl MavFtpErr {
2294 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2295}
2296impl Default for MavFtpErr {
2297 fn default() -> Self {
2298 Self::DEFAULT
2299 }
2300}
2301#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2303#[cfg_attr(feature = "serde", serde(tag = "type"))]
2304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2305#[repr(u32)]
2306#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2307pub enum MavFtpOpcode {
2308 #[doc = "None. Ignored, always ACKed"]
2309 MAV_FTP_OPCODE_NONE = 0,
2310 #[doc = "TerminateSession: Terminates open Read session"]
2311 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2312 #[doc = "ResetSessions: Terminates all open read sessions"]
2313 MAV_FTP_OPCODE_RESETSESSION = 2,
2314 #[doc = "ListDirectory. List files and directories in path from offset"]
2315 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2316 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2317 MAV_FTP_OPCODE_OPENFILERO = 4,
2318 #[doc = "ReadFile: Reads size bytes from offset in session"]
2319 MAV_FTP_OPCODE_READFILE = 5,
2320 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2321 MAV_FTP_OPCODE_CREATEFILE = 6,
2322 #[doc = "WriteFile: Writes size bytes to offset in session"]
2323 MAV_FTP_OPCODE_WRITEFILE = 7,
2324 #[doc = "RemoveFile: Remove file at path"]
2325 MAV_FTP_OPCODE_REMOVEFILE = 8,
2326 #[doc = "CreateDirectory: Creates directory at path"]
2327 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2328 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2329 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2330 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2331 MAV_FTP_OPCODE_OPENFILEWO = 11,
2332 #[doc = "TruncateFile: Truncate file at path to offset length"]
2333 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2334 #[doc = "Rename: Rename path1 to path2"]
2335 MAV_FTP_OPCODE_RENAME = 13,
2336 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2337 MAV_FTP_OPCODE_CALCFILECRC = 14,
2338 #[doc = "BurstReadFile: Burst download session file"]
2339 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2340 #[doc = "ACK: ACK response"]
2341 MAV_FTP_OPCODE_ACK = 128,
2342 #[doc = "NAK: NAK response"]
2343 MAV_FTP_OPCODE_NAK = 129,
2344}
2345impl MavFtpOpcode {
2346 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2347}
2348impl Default for MavFtpOpcode {
2349 fn default() -> Self {
2350 Self::DEFAULT
2351 }
2352}
2353#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2354#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2355#[cfg_attr(feature = "serde", serde(tag = "type"))]
2356#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2357#[repr(u32)]
2358#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2359pub enum MavFuelType {
2360 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2361 MAV_FUEL_TYPE_UNKNOWN = 0,
2362 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2363 MAV_FUEL_TYPE_LIQUID = 1,
2364 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2365 MAV_FUEL_TYPE_GAS = 2,
2366}
2367impl MavFuelType {
2368 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2369}
2370impl Default for MavFuelType {
2371 fn default() -> Self {
2372 Self::DEFAULT
2373 }
2374}
2375bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2376impl MavGeneratorStatusFlag {
2377 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2378}
2379impl Default for MavGeneratorStatusFlag {
2380 fn default() -> Self {
2381 Self::DEFAULT
2382 }
2383}
2384#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2385#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2386#[cfg_attr(feature = "serde", serde(tag = "type"))]
2387#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2388#[repr(u32)]
2389#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2390pub enum MavGoto {
2391 #[doc = "Hold at the current position."]
2392 MAV_GOTO_DO_HOLD = 0,
2393 #[doc = "Continue with the next item in mission execution."]
2394 MAV_GOTO_DO_CONTINUE = 1,
2395 #[doc = "Hold at the current position of the system"]
2396 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2397 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2398 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2399}
2400impl MavGoto {
2401 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2402}
2403impl Default for MavGoto {
2404 fn default() -> Self {
2405 Self::DEFAULT
2406 }
2407}
2408#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2409#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2410#[cfg_attr(feature = "serde", serde(tag = "type"))]
2411#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2412#[repr(u32)]
2413#[doc = "Enumeration of landed detector states"]
2414pub enum MavLandedState {
2415 #[doc = "MAV landed state is unknown"]
2416 MAV_LANDED_STATE_UNDEFINED = 0,
2417 #[doc = "MAV is landed (on ground)"]
2418 MAV_LANDED_STATE_ON_GROUND = 1,
2419 #[doc = "MAV is in air"]
2420 MAV_LANDED_STATE_IN_AIR = 2,
2421 #[doc = "MAV currently taking off"]
2422 MAV_LANDED_STATE_TAKEOFF = 3,
2423 #[doc = "MAV currently landing"]
2424 MAV_LANDED_STATE_LANDING = 4,
2425}
2426impl MavLandedState {
2427 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2428}
2429impl Default for MavLandedState {
2430 fn default() -> Self {
2431 Self::DEFAULT
2432 }
2433}
2434#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2435#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2436#[cfg_attr(feature = "serde", serde(tag = "type"))]
2437#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2438#[repr(u32)]
2439#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2440pub enum MavMissionResult {
2441 #[doc = "mission accepted OK"]
2442 MAV_MISSION_ACCEPTED = 0,
2443 #[doc = "Generic error / not accepting mission commands at all right now."]
2444 MAV_MISSION_ERROR = 1,
2445 #[doc = "Coordinate frame is not supported."]
2446 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2447 #[doc = "Command is not supported."]
2448 MAV_MISSION_UNSUPPORTED = 3,
2449 #[doc = "Mission items exceed storage space."]
2450 MAV_MISSION_NO_SPACE = 4,
2451 #[doc = "One of the parameters has an invalid value."]
2452 MAV_MISSION_INVALID = 5,
2453 #[doc = "param1 has an invalid value."]
2454 MAV_MISSION_INVALID_PARAM1 = 6,
2455 #[doc = "param2 has an invalid value."]
2456 MAV_MISSION_INVALID_PARAM2 = 7,
2457 #[doc = "param3 has an invalid value."]
2458 MAV_MISSION_INVALID_PARAM3 = 8,
2459 #[doc = "param4 has an invalid value."]
2460 MAV_MISSION_INVALID_PARAM4 = 9,
2461 #[doc = "x / param5 has an invalid value."]
2462 MAV_MISSION_INVALID_PARAM5_X = 10,
2463 #[doc = "y / param6 has an invalid value."]
2464 MAV_MISSION_INVALID_PARAM6_Y = 11,
2465 #[doc = "z / param7 has an invalid value."]
2466 MAV_MISSION_INVALID_PARAM7 = 12,
2467 #[doc = "Mission item received out of sequence"]
2468 MAV_MISSION_INVALID_SEQUENCE = 13,
2469 #[doc = "Not accepting any mission commands from this communication partner."]
2470 MAV_MISSION_DENIED = 14,
2471 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2472 MAV_MISSION_OPERATION_CANCELLED = 15,
2473}
2474impl MavMissionResult {
2475 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2476}
2477impl Default for MavMissionResult {
2478 fn default() -> Self {
2479 Self::DEFAULT
2480 }
2481}
2482#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2483#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2484#[cfg_attr(feature = "serde", serde(tag = "type"))]
2485#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2486#[repr(u32)]
2487#[doc = "Type of mission items being requested/sent in mission protocol."]
2488pub enum MavMissionType {
2489 #[doc = "Items are mission commands for main mission."]
2490 MAV_MISSION_TYPE_MISSION = 0,
2491 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2492 MAV_MISSION_TYPE_FENCE = 1,
2493 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2494 MAV_MISSION_TYPE_RALLY = 2,
2495 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2496 MAV_MISSION_TYPE_ALL = 255,
2497}
2498impl MavMissionType {
2499 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2500}
2501impl Default for MavMissionType {
2502 fn default() -> Self {
2503 Self::DEFAULT
2504 }
2505}
2506#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2507#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2508#[cfg_attr(feature = "serde", serde(tag = "type"))]
2509#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2510#[repr(u32)]
2511#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2512pub enum MavMode {
2513 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2514 MAV_MODE_PREFLIGHT = 0,
2515 #[doc = "System is allowed to be active, under assisted RC control."]
2516 MAV_MODE_STABILIZE_DISARMED = 80,
2517 #[doc = "System is allowed to be active, under assisted RC control."]
2518 MAV_MODE_STABILIZE_ARMED = 208,
2519 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2520 MAV_MODE_MANUAL_DISARMED = 64,
2521 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2522 MAV_MODE_MANUAL_ARMED = 192,
2523 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2524 MAV_MODE_GUIDED_DISARMED = 88,
2525 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2526 MAV_MODE_GUIDED_ARMED = 216,
2527 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2528 MAV_MODE_AUTO_DISARMED = 92,
2529 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2530 MAV_MODE_AUTO_ARMED = 220,
2531 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2532 MAV_MODE_TEST_DISARMED = 66,
2533 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2534 MAV_MODE_TEST_ARMED = 194,
2535}
2536impl MavMode {
2537 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2538}
2539impl Default for MavMode {
2540 fn default() -> Self {
2541 Self::DEFAULT
2542 }
2543}
2544bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2545impl MavModeFlag {
2546 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2547}
2548impl Default for MavModeFlag {
2549 fn default() -> Self {
2550 Self::DEFAULT
2551 }
2552}
2553#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2554#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2555#[cfg_attr(feature = "serde", serde(tag = "type"))]
2556#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2557#[repr(u32)]
2558#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2559pub enum MavModeFlagDecodePosition {
2560 #[doc = "First bit: 10000000"]
2561 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2562 #[doc = "Second bit: 01000000"]
2563 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2564 #[doc = "Third bit: 00100000"]
2565 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2566 #[doc = "Fourth bit: 00010000"]
2567 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2568 #[doc = "Fifth bit: 00001000"]
2569 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2570 #[doc = "Sixth bit: 00000100"]
2571 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2572 #[doc = "Seventh bit: 00000010"]
2573 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2574 #[doc = "Eighth bit: 00000001"]
2575 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2576}
2577impl MavModeFlagDecodePosition {
2578 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2579}
2580impl Default for MavModeFlagDecodePosition {
2581 fn default() -> Self {
2582 Self::DEFAULT
2583 }
2584}
2585bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2586impl MavModeProperty {
2587 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2588}
2589impl Default for MavModeProperty {
2590 fn default() -> Self {
2591 Self::DEFAULT
2592 }
2593}
2594#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2596#[cfg_attr(feature = "serde", serde(tag = "type"))]
2597#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2598#[repr(u32)]
2599#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2600#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2601pub enum MavMountMode {
2602 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2603 MAV_MOUNT_MODE_RETRACT = 0,
2604 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2605 MAV_MOUNT_MODE_NEUTRAL = 1,
2606 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2607 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2608 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2609 MAV_MOUNT_MODE_RC_TARGETING = 3,
2610 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2611 MAV_MOUNT_MODE_GPS_POINT = 4,
2612 #[doc = "Gimbal tracks system with specified system ID"]
2613 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2614 #[doc = "Gimbal tracks home position"]
2615 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2616}
2617impl MavMountMode {
2618 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2619}
2620impl Default for MavMountMode {
2621 fn default() -> Self {
2622 Self::DEFAULT
2623 }
2624}
2625#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2626#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2627#[cfg_attr(feature = "serde", serde(tag = "type"))]
2628#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2629#[repr(u32)]
2630pub enum MavOdidArmStatus {
2631 #[doc = "Passing arming checks."]
2632 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2633 #[doc = "Generic arming failure, see error string for details."]
2634 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2635}
2636impl MavOdidArmStatus {
2637 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2638}
2639impl Default for MavOdidArmStatus {
2640 fn default() -> Self {
2641 Self::DEFAULT
2642 }
2643}
2644#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2645#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2646#[cfg_attr(feature = "serde", serde(tag = "type"))]
2647#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2648#[repr(u32)]
2649pub enum MavOdidAuthType {
2650 #[doc = "No authentication type is specified."]
2651 MAV_ODID_AUTH_TYPE_NONE = 0,
2652 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2653 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2654 #[doc = "Signature for the Operator ID."]
2655 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2656 #[doc = "Signature for the entire message set."]
2657 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2658 #[doc = "Authentication is provided by Network Remote ID."]
2659 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2660 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2661 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2662}
2663impl MavOdidAuthType {
2664 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2665}
2666impl Default for MavOdidAuthType {
2667 fn default() -> Self {
2668 Self::DEFAULT
2669 }
2670}
2671#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2672#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2673#[cfg_attr(feature = "serde", serde(tag = "type"))]
2674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2675#[repr(u32)]
2676pub enum MavOdidCategoryEu {
2677 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2678 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2679 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2680 MAV_ODID_CATEGORY_EU_OPEN = 1,
2681 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2682 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2683 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2684 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2685}
2686impl MavOdidCategoryEu {
2687 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2688}
2689impl Default for MavOdidCategoryEu {
2690 fn default() -> Self {
2691 Self::DEFAULT
2692 }
2693}
2694#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2695#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2696#[cfg_attr(feature = "serde", serde(tag = "type"))]
2697#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2698#[repr(u32)]
2699pub enum MavOdidClassEu {
2700 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2701 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2702 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2703 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2704 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2705 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2706 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2707 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2708 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2709 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2710 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2711 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2712 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2713 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2714 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2715 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2716}
2717impl MavOdidClassEu {
2718 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2719}
2720impl Default for MavOdidClassEu {
2721 fn default() -> Self {
2722 Self::DEFAULT
2723 }
2724}
2725#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2726#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2727#[cfg_attr(feature = "serde", serde(tag = "type"))]
2728#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2729#[repr(u32)]
2730pub enum MavOdidClassificationType {
2731 #[doc = "The classification type for the UA is undeclared."]
2732 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2733 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2734 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2735}
2736impl MavOdidClassificationType {
2737 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2738}
2739impl Default for MavOdidClassificationType {
2740 fn default() -> Self {
2741 Self::DEFAULT
2742 }
2743}
2744#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2745#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2746#[cfg_attr(feature = "serde", serde(tag = "type"))]
2747#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2748#[repr(u32)]
2749pub enum MavOdidDescType {
2750 #[doc = "Optional free-form text description of the purpose of the flight."]
2751 MAV_ODID_DESC_TYPE_TEXT = 0,
2752 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2753 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2754 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2755 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2756}
2757impl MavOdidDescType {
2758 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2759}
2760impl Default for MavOdidDescType {
2761 fn default() -> Self {
2762 Self::DEFAULT
2763 }
2764}
2765#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2767#[cfg_attr(feature = "serde", serde(tag = "type"))]
2768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2769#[repr(u32)]
2770pub enum MavOdidHeightRef {
2771 #[doc = "The height field is relative to the take-off location."]
2772 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2773 #[doc = "The height field is relative to ground."]
2774 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2775}
2776impl MavOdidHeightRef {
2777 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2778}
2779impl Default for MavOdidHeightRef {
2780 fn default() -> Self {
2781 Self::DEFAULT
2782 }
2783}
2784#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2785#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2786#[cfg_attr(feature = "serde", serde(tag = "type"))]
2787#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2788#[repr(u32)]
2789pub enum MavOdidHorAcc {
2790 #[doc = "The horizontal accuracy is unknown."]
2791 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2792 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2793 MAV_ODID_HOR_ACC_10NM = 1,
2794 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2795 MAV_ODID_HOR_ACC_4NM = 2,
2796 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2797 MAV_ODID_HOR_ACC_2NM = 3,
2798 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2799 MAV_ODID_HOR_ACC_1NM = 4,
2800 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2801 MAV_ODID_HOR_ACC_0_5NM = 5,
2802 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2803 MAV_ODID_HOR_ACC_0_3NM = 6,
2804 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2805 MAV_ODID_HOR_ACC_0_1NM = 7,
2806 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2807 MAV_ODID_HOR_ACC_0_05NM = 8,
2808 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2809 MAV_ODID_HOR_ACC_30_METER = 9,
2810 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2811 MAV_ODID_HOR_ACC_10_METER = 10,
2812 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2813 MAV_ODID_HOR_ACC_3_METER = 11,
2814 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2815 MAV_ODID_HOR_ACC_1_METER = 12,
2816}
2817impl MavOdidHorAcc {
2818 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2819}
2820impl Default for MavOdidHorAcc {
2821 fn default() -> Self {
2822 Self::DEFAULT
2823 }
2824}
2825#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2826#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2827#[cfg_attr(feature = "serde", serde(tag = "type"))]
2828#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2829#[repr(u32)]
2830pub enum MavOdidIdType {
2831 #[doc = "No type defined."]
2832 MAV_ODID_ID_TYPE_NONE = 0,
2833 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2834 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2835 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2836 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2837 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2838 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2839 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2840 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2841}
2842impl MavOdidIdType {
2843 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2844}
2845impl Default for MavOdidIdType {
2846 fn default() -> Self {
2847 Self::DEFAULT
2848 }
2849}
2850#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2851#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2852#[cfg_attr(feature = "serde", serde(tag = "type"))]
2853#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2854#[repr(u32)]
2855pub enum MavOdidOperatorIdType {
2856 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2857 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2858}
2859impl MavOdidOperatorIdType {
2860 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2861}
2862impl Default for MavOdidOperatorIdType {
2863 fn default() -> Self {
2864 Self::DEFAULT
2865 }
2866}
2867#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2868#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2869#[cfg_attr(feature = "serde", serde(tag = "type"))]
2870#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2871#[repr(u32)]
2872pub enum MavOdidOperatorLocationType {
2873 #[doc = "The location/altitude of the operator is the same as the take-off location."]
2874 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
2875 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
2876 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
2877 #[doc = "The location/altitude of the operator are fixed values."]
2878 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
2879}
2880impl MavOdidOperatorLocationType {
2881 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
2882}
2883impl Default for MavOdidOperatorLocationType {
2884 fn default() -> Self {
2885 Self::DEFAULT
2886 }
2887}
2888#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2889#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2890#[cfg_attr(feature = "serde", serde(tag = "type"))]
2891#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2892#[repr(u32)]
2893pub enum MavOdidSpeedAcc {
2894 #[doc = "The speed accuracy is unknown."]
2895 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
2896 #[doc = "The speed accuracy is smaller than 10 meters per second."]
2897 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
2898 #[doc = "The speed accuracy is smaller than 3 meters per second."]
2899 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
2900 #[doc = "The speed accuracy is smaller than 1 meters per second."]
2901 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
2902 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
2903 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
2904}
2905impl MavOdidSpeedAcc {
2906 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
2907}
2908impl Default for MavOdidSpeedAcc {
2909 fn default() -> Self {
2910 Self::DEFAULT
2911 }
2912}
2913#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2915#[cfg_attr(feature = "serde", serde(tag = "type"))]
2916#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2917#[repr(u32)]
2918pub enum MavOdidStatus {
2919 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
2920 MAV_ODID_STATUS_UNDECLARED = 0,
2921 #[doc = "The UA is on the ground."]
2922 MAV_ODID_STATUS_GROUND = 1,
2923 #[doc = "The UA is in the air."]
2924 MAV_ODID_STATUS_AIRBORNE = 2,
2925 #[doc = "The UA is having an emergency."]
2926 MAV_ODID_STATUS_EMERGENCY = 3,
2927 #[doc = "The remote ID system is failing or unreliable in some way."]
2928 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
2929}
2930impl MavOdidStatus {
2931 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
2932}
2933impl Default for MavOdidStatus {
2934 fn default() -> Self {
2935 Self::DEFAULT
2936 }
2937}
2938#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2939#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2940#[cfg_attr(feature = "serde", serde(tag = "type"))]
2941#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2942#[repr(u32)]
2943pub enum MavOdidTimeAcc {
2944 #[doc = "The timestamp accuracy is unknown."]
2945 MAV_ODID_TIME_ACC_UNKNOWN = 0,
2946 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
2947 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
2948 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
2949 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
2950 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
2951 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
2952 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
2953 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
2954 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
2955 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
2956 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
2957 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
2958 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
2959 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
2960 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
2961 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
2962 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
2963 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
2964 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
2965 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
2966 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
2967 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
2968 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
2969 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
2970 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
2971 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
2972 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
2973 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
2974 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
2975 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
2976}
2977impl MavOdidTimeAcc {
2978 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
2979}
2980impl Default for MavOdidTimeAcc {
2981 fn default() -> Self {
2982 Self::DEFAULT
2983 }
2984}
2985#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2986#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2987#[cfg_attr(feature = "serde", serde(tag = "type"))]
2988#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2989#[repr(u32)]
2990pub enum MavOdidUaType {
2991 #[doc = "No UA (Unmanned Aircraft) type defined."]
2992 MAV_ODID_UA_TYPE_NONE = 0,
2993 #[doc = "Aeroplane/Airplane. Fixed wing."]
2994 MAV_ODID_UA_TYPE_AEROPLANE = 1,
2995 #[doc = "Helicopter or multirotor."]
2996 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
2997 #[doc = "Gyroplane."]
2998 MAV_ODID_UA_TYPE_GYROPLANE = 3,
2999 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3000 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3001 #[doc = "Ornithopter."]
3002 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3003 #[doc = "Glider."]
3004 MAV_ODID_UA_TYPE_GLIDER = 6,
3005 #[doc = "Kite."]
3006 MAV_ODID_UA_TYPE_KITE = 7,
3007 #[doc = "Free Balloon."]
3008 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3009 #[doc = "Captive Balloon."]
3010 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3011 #[doc = "Airship. E.g. a blimp."]
3012 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3013 #[doc = "Free Fall/Parachute (unpowered)."]
3014 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3015 #[doc = "Rocket."]
3016 MAV_ODID_UA_TYPE_ROCKET = 12,
3017 #[doc = "Tethered powered aircraft."]
3018 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3019 #[doc = "Ground Obstacle."]
3020 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3021 #[doc = "Other type of aircraft not listed earlier."]
3022 MAV_ODID_UA_TYPE_OTHER = 15,
3023}
3024impl MavOdidUaType {
3025 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3026}
3027impl Default for MavOdidUaType {
3028 fn default() -> Self {
3029 Self::DEFAULT
3030 }
3031}
3032#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3033#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3034#[cfg_attr(feature = "serde", serde(tag = "type"))]
3035#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3036#[repr(u32)]
3037pub enum MavOdidVerAcc {
3038 #[doc = "The vertical accuracy is unknown."]
3039 MAV_ODID_VER_ACC_UNKNOWN = 0,
3040 #[doc = "The vertical accuracy is smaller than 150 meter."]
3041 MAV_ODID_VER_ACC_150_METER = 1,
3042 #[doc = "The vertical accuracy is smaller than 45 meter."]
3043 MAV_ODID_VER_ACC_45_METER = 2,
3044 #[doc = "The vertical accuracy is smaller than 25 meter."]
3045 MAV_ODID_VER_ACC_25_METER = 3,
3046 #[doc = "The vertical accuracy is smaller than 10 meter."]
3047 MAV_ODID_VER_ACC_10_METER = 4,
3048 #[doc = "The vertical accuracy is smaller than 3 meter."]
3049 MAV_ODID_VER_ACC_3_METER = 5,
3050 #[doc = "The vertical accuracy is smaller than 1 meter."]
3051 MAV_ODID_VER_ACC_1_METER = 6,
3052}
3053impl MavOdidVerAcc {
3054 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3055}
3056impl Default for MavOdidVerAcc {
3057 fn default() -> Self {
3058 Self::DEFAULT
3059 }
3060}
3061#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3062#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3063#[cfg_attr(feature = "serde", serde(tag = "type"))]
3064#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3065#[repr(u32)]
3066#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3067pub enum MavParamExtType {
3068 #[doc = "8-bit unsigned integer"]
3069 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3070 #[doc = "8-bit signed integer"]
3071 MAV_PARAM_EXT_TYPE_INT8 = 2,
3072 #[doc = "16-bit unsigned integer"]
3073 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3074 #[doc = "16-bit signed integer"]
3075 MAV_PARAM_EXT_TYPE_INT16 = 4,
3076 #[doc = "32-bit unsigned integer"]
3077 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3078 #[doc = "32-bit signed integer"]
3079 MAV_PARAM_EXT_TYPE_INT32 = 6,
3080 #[doc = "64-bit unsigned integer"]
3081 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3082 #[doc = "64-bit signed integer"]
3083 MAV_PARAM_EXT_TYPE_INT64 = 8,
3084 #[doc = "32-bit floating-point"]
3085 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3086 #[doc = "64-bit floating-point"]
3087 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3088 #[doc = "Custom Type"]
3089 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3090}
3091impl MavParamExtType {
3092 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3093}
3094impl Default for MavParamExtType {
3095 fn default() -> Self {
3096 Self::DEFAULT
3097 }
3098}
3099#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3100#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3101#[cfg_attr(feature = "serde", serde(tag = "type"))]
3102#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3103#[repr(u32)]
3104#[doc = "Specifies the datatype of a MAVLink parameter."]
3105pub enum MavParamType {
3106 #[doc = "8-bit unsigned integer"]
3107 MAV_PARAM_TYPE_UINT8 = 1,
3108 #[doc = "8-bit signed integer"]
3109 MAV_PARAM_TYPE_INT8 = 2,
3110 #[doc = "16-bit unsigned integer"]
3111 MAV_PARAM_TYPE_UINT16 = 3,
3112 #[doc = "16-bit signed integer"]
3113 MAV_PARAM_TYPE_INT16 = 4,
3114 #[doc = "32-bit unsigned integer"]
3115 MAV_PARAM_TYPE_UINT32 = 5,
3116 #[doc = "32-bit signed integer"]
3117 MAV_PARAM_TYPE_INT32 = 6,
3118 #[doc = "64-bit unsigned integer"]
3119 MAV_PARAM_TYPE_UINT64 = 7,
3120 #[doc = "64-bit signed integer"]
3121 MAV_PARAM_TYPE_INT64 = 8,
3122 #[doc = "32-bit floating-point"]
3123 MAV_PARAM_TYPE_REAL32 = 9,
3124 #[doc = "64-bit floating-point"]
3125 MAV_PARAM_TYPE_REAL64 = 10,
3126}
3127impl MavParamType {
3128 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3129}
3130impl Default for MavParamType {
3131 fn default() -> Self {
3132 Self::DEFAULT
3133 }
3134}
3135bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3136impl MavPowerStatus {
3137 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3138}
3139impl Default for MavPowerStatus {
3140 fn default() -> Self {
3141 Self::DEFAULT
3142 }
3143}
3144bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3145impl MavProtocolCapability {
3146 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3147}
3148impl Default for MavProtocolCapability {
3149 fn default() -> Self {
3150 Self::DEFAULT
3151 }
3152}
3153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3155#[cfg_attr(feature = "serde", serde(tag = "type"))]
3156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3157#[repr(u32)]
3158#[doc = "Result from a MAVLink command (MAV_CMD)"]
3159pub enum MavResult {
3160 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3161 MAV_RESULT_ACCEPTED = 0,
3162 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3163 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3164 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3165 MAV_RESULT_DENIED = 2,
3166 #[doc = "Command is not supported (unknown)."]
3167 MAV_RESULT_UNSUPPORTED = 3,
3168 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3169 MAV_RESULT_FAILED = 4,
3170 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3171 MAV_RESULT_IN_PROGRESS = 5,
3172 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3173 MAV_RESULT_CANCELLED = 6,
3174 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3175 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3176 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3177 MAV_RESULT_COMMAND_INT_ONLY = 8,
3178 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3179 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3180}
3181impl MavResult {
3182 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3183}
3184impl Default for MavResult {
3185 fn default() -> Self {
3186 Self::DEFAULT
3187 }
3188}
3189#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3190#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3191#[cfg_attr(feature = "serde", serde(tag = "type"))]
3192#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3193#[repr(u32)]
3194#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3195#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3196pub enum MavRoi {
3197 #[doc = "No region of interest."]
3198 MAV_ROI_NONE = 0,
3199 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3200 MAV_ROI_WPNEXT = 1,
3201 #[doc = "Point toward given waypoint."]
3202 MAV_ROI_WPINDEX = 2,
3203 #[doc = "Point toward fixed location."]
3204 MAV_ROI_LOCATION = 3,
3205 #[doc = "Point toward of given id."]
3206 MAV_ROI_TARGET = 4,
3207}
3208impl MavRoi {
3209 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3210}
3211impl Default for MavRoi {
3212 fn default() -> Self {
3213 Self::DEFAULT
3214 }
3215}
3216#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3217#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3218#[cfg_attr(feature = "serde", serde(tag = "type"))]
3219#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3220#[repr(u32)]
3221#[doc = "Enumeration of sensor orientation, according to its rotations"]
3222pub enum MavSensorOrientation {
3223 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3224 MAV_SENSOR_ROTATION_NONE = 0,
3225 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3226 MAV_SENSOR_ROTATION_YAW_45 = 1,
3227 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3228 MAV_SENSOR_ROTATION_YAW_90 = 2,
3229 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3230 MAV_SENSOR_ROTATION_YAW_135 = 3,
3231 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3232 MAV_SENSOR_ROTATION_YAW_180 = 4,
3233 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3234 MAV_SENSOR_ROTATION_YAW_225 = 5,
3235 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3236 MAV_SENSOR_ROTATION_YAW_270 = 6,
3237 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3238 MAV_SENSOR_ROTATION_YAW_315 = 7,
3239 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3240 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3241 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3242 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3243 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3244 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3245 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3246 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3247 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3248 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3249 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3250 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3251 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3252 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3253 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3254 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3255 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3256 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3257 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3258 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3259 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3260 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3261 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3262 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3263 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3264 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3265 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3266 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3267 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3268 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3269 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3270 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3271 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3272 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3273 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3274 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3275 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3276 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3277 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3278 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3279 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3280 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3281 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3282 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3283 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3284 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3285 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3286 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3287 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3288 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3289 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3290 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3291 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3292 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3293 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3294 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3295 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3296 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3297 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3298 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3299 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3300 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3301 #[doc = "Pitch: 315"]
3302 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3303 #[doc = "Roll: 90, Pitch: 315"]
3304 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3305 #[doc = "Custom orientation"]
3306 MAV_SENSOR_ROTATION_CUSTOM = 100,
3307}
3308impl MavSensorOrientation {
3309 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3310}
3311impl Default for MavSensorOrientation {
3312 fn default() -> Self {
3313 Self::DEFAULT
3314 }
3315}
3316#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3317#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3318#[cfg_attr(feature = "serde", serde(tag = "type"))]
3319#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3320#[repr(u32)]
3321#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3322pub enum MavSeverity {
3323 #[doc = "System is unusable. This is a \"panic\" condition."]
3324 MAV_SEVERITY_EMERGENCY = 0,
3325 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3326 MAV_SEVERITY_ALERT = 1,
3327 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3328 MAV_SEVERITY_CRITICAL = 2,
3329 #[doc = "Indicates an error in secondary/redundant systems."]
3330 MAV_SEVERITY_ERROR = 3,
3331 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3332 MAV_SEVERITY_WARNING = 4,
3333 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3334 MAV_SEVERITY_NOTICE = 5,
3335 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3336 MAV_SEVERITY_INFO = 6,
3337 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3338 MAV_SEVERITY_DEBUG = 7,
3339}
3340impl MavSeverity {
3341 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3342}
3343impl Default for MavSeverity {
3344 fn default() -> Self {
3345 Self::DEFAULT
3346 }
3347}
3348#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3350#[cfg_attr(feature = "serde", serde(tag = "type"))]
3351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3352#[repr(u32)]
3353#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3354pub enum MavStandardMode {
3355 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3356 MAV_STANDARD_MODE_NON_STANDARD = 0,
3357 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3358 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3359 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3360 MAV_STANDARD_MODE_ORBIT = 2,
3361 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3362 MAV_STANDARD_MODE_CRUISE = 3,
3363 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3364 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3365 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3366 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3367 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3368 MAV_STANDARD_MODE_MISSION = 6,
3369 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3370 MAV_STANDARD_MODE_LAND = 7,
3371 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3372 MAV_STANDARD_MODE_TAKEOFF = 8,
3373}
3374impl MavStandardMode {
3375 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3376}
3377impl Default for MavStandardMode {
3378 fn default() -> Self {
3379 Self::DEFAULT
3380 }
3381}
3382#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3383#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3384#[cfg_attr(feature = "serde", serde(tag = "type"))]
3385#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3386#[repr(u32)]
3387pub enum MavState {
3388 #[doc = "Uninitialized system, state is unknown."]
3389 MAV_STATE_UNINIT = 0,
3390 #[doc = "System is booting up."]
3391 MAV_STATE_BOOT = 1,
3392 #[doc = "System is calibrating and not flight-ready."]
3393 MAV_STATE_CALIBRATING = 2,
3394 #[doc = "System is grounded and on standby. It can be launched any time."]
3395 MAV_STATE_STANDBY = 3,
3396 #[doc = "System is active and might be already airborne. Motors are engaged."]
3397 MAV_STATE_ACTIVE = 4,
3398 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3399 MAV_STATE_CRITICAL = 5,
3400 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3401 MAV_STATE_EMERGENCY = 6,
3402 #[doc = "System just initialized its power-down sequence, will shut down now."]
3403 MAV_STATE_POWEROFF = 7,
3404 #[doc = "System is terminating itself (failsafe or commanded)."]
3405 MAV_STATE_FLIGHT_TERMINATION = 8,
3406}
3407impl MavState {
3408 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3409}
3410impl Default for MavState {
3411 fn default() -> Self {
3412 Self::DEFAULT
3413 }
3414}
3415bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3416impl MavSysStatusSensor {
3417 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3418}
3419impl Default for MavSysStatusSensor {
3420 fn default() -> Self {
3421 Self::DEFAULT
3422 }
3423}
3424bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3425impl MavSysStatusSensorExtended {
3426 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3427}
3428impl Default for MavSysStatusSensorExtended {
3429 fn default() -> Self {
3430 Self::DEFAULT
3431 }
3432}
3433#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3434#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3435#[cfg_attr(feature = "serde", serde(tag = "type"))]
3436#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3437#[repr(u32)]
3438pub enum MavTunnelPayloadType {
3439 #[doc = "Encoding of payload unknown."]
3440 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3441 #[doc = "Registered for STorM32 gimbal controller."]
3442 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3443 #[doc = "Registered for STorM32 gimbal controller."]
3444 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3445 #[doc = "Registered for STorM32 gimbal controller."]
3446 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3447 #[doc = "Registered for STorM32 gimbal controller."]
3448 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3449 #[doc = "Registered for STorM32 gimbal controller."]
3450 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3451 #[doc = "Registered for STorM32 gimbal controller."]
3452 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3453 #[doc = "Registered for STorM32 gimbal controller."]
3454 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3455 #[doc = "Registered for STorM32 gimbal controller."]
3456 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3457 #[doc = "Registered for STorM32 gimbal controller."]
3458 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3459 #[doc = "Registered for STorM32 gimbal controller."]
3460 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3461 #[doc = "Registered for ModalAI remote OSD protocol."]
3462 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3463 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3464 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3465 #[doc = "Registered for ModalAI vendor use."]
3466 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3467}
3468impl MavTunnelPayloadType {
3469 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3470}
3471impl Default for MavTunnelPayloadType {
3472 fn default() -> Self {
3473 Self::DEFAULT
3474 }
3475}
3476#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3478#[cfg_attr(feature = "serde", serde(tag = "type"))]
3479#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3480#[repr(u32)]
3481#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3482pub enum MavType {
3483 #[doc = "Generic micro air vehicle"]
3484 MAV_TYPE_GENERIC = 0,
3485 #[doc = "Fixed wing aircraft."]
3486 MAV_TYPE_FIXED_WING = 1,
3487 #[doc = "Quadrotor"]
3488 MAV_TYPE_QUADROTOR = 2,
3489 #[doc = "Coaxial helicopter"]
3490 MAV_TYPE_COAXIAL = 3,
3491 #[doc = "Normal helicopter with tail rotor."]
3492 MAV_TYPE_HELICOPTER = 4,
3493 #[doc = "Ground installation"]
3494 MAV_TYPE_ANTENNA_TRACKER = 5,
3495 #[doc = "Operator control unit / ground control station"]
3496 MAV_TYPE_GCS = 6,
3497 #[doc = "Airship, controlled"]
3498 MAV_TYPE_AIRSHIP = 7,
3499 #[doc = "Free balloon, uncontrolled"]
3500 MAV_TYPE_FREE_BALLOON = 8,
3501 #[doc = "Rocket"]
3502 MAV_TYPE_ROCKET = 9,
3503 #[doc = "Ground rover"]
3504 MAV_TYPE_GROUND_ROVER = 10,
3505 #[doc = "Surface vessel, boat, ship"]
3506 MAV_TYPE_SURFACE_BOAT = 11,
3507 #[doc = "Submarine"]
3508 MAV_TYPE_SUBMARINE = 12,
3509 #[doc = "Hexarotor"]
3510 MAV_TYPE_HEXAROTOR = 13,
3511 #[doc = "Octorotor"]
3512 MAV_TYPE_OCTOROTOR = 14,
3513 #[doc = "Tricopter"]
3514 MAV_TYPE_TRICOPTER = 15,
3515 #[doc = "Flapping wing"]
3516 MAV_TYPE_FLAPPING_WING = 16,
3517 #[doc = "Kite"]
3518 MAV_TYPE_KITE = 17,
3519 #[doc = "Onboard companion controller"]
3520 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3521 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3522 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3523 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3524 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3525 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3526 MAV_TYPE_VTOL_TILTROTOR = 21,
3527 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3528 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3529 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3530 MAV_TYPE_VTOL_TAILSITTER = 23,
3531 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3532 MAV_TYPE_VTOL_TILTWING = 24,
3533 #[doc = "VTOL reserved 5"]
3534 MAV_TYPE_VTOL_RESERVED5 = 25,
3535 #[doc = "Gimbal"]
3536 MAV_TYPE_GIMBAL = 26,
3537 #[doc = "ADSB system"]
3538 MAV_TYPE_ADSB = 27,
3539 #[doc = "Steerable, nonrigid airfoil"]
3540 MAV_TYPE_PARAFOIL = 28,
3541 #[doc = "Dodecarotor"]
3542 MAV_TYPE_DODECAROTOR = 29,
3543 #[doc = "Camera"]
3544 MAV_TYPE_CAMERA = 30,
3545 #[doc = "Charging station"]
3546 MAV_TYPE_CHARGING_STATION = 31,
3547 #[doc = "FLARM collision avoidance system"]
3548 MAV_TYPE_FLARM = 32,
3549 #[doc = "Servo"]
3550 MAV_TYPE_SERVO = 33,
3551 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3552 MAV_TYPE_ODID = 34,
3553 #[doc = "Decarotor"]
3554 MAV_TYPE_DECAROTOR = 35,
3555 #[doc = "Battery"]
3556 MAV_TYPE_BATTERY = 36,
3557 #[doc = "Parachute"]
3558 MAV_TYPE_PARACHUTE = 37,
3559 #[doc = "Log"]
3560 MAV_TYPE_LOG = 38,
3561 #[doc = "OSD"]
3562 MAV_TYPE_OSD = 39,
3563 #[doc = "IMU"]
3564 MAV_TYPE_IMU = 40,
3565 #[doc = "GPS"]
3566 MAV_TYPE_GPS = 41,
3567 #[doc = "Winch"]
3568 MAV_TYPE_WINCH = 42,
3569 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3570 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3571 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3572 MAV_TYPE_ILLUMINATOR = 44,
3573 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3574 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3575}
3576impl MavType {
3577 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3578}
3579impl Default for MavType {
3580 fn default() -> Self {
3581 Self::DEFAULT
3582 }
3583}
3584#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3585#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3586#[cfg_attr(feature = "serde", serde(tag = "type"))]
3587#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3588#[repr(u32)]
3589#[doc = "Enumeration of VTOL states"]
3590pub enum MavVtolState {
3591 #[doc = "MAV is not configured as VTOL"]
3592 MAV_VTOL_STATE_UNDEFINED = 0,
3593 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3594 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3595 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3596 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3597 #[doc = "VTOL is in multicopter state"]
3598 MAV_VTOL_STATE_MC = 3,
3599 #[doc = "VTOL is in fixed-wing state"]
3600 MAV_VTOL_STATE_FW = 4,
3601}
3602impl MavVtolState {
3603 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3604}
3605impl Default for MavVtolState {
3606 fn default() -> Self {
3607 Self::DEFAULT
3608 }
3609}
3610bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3611impl MavWinchStatusFlag {
3612 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3613}
3614impl Default for MavWinchStatusFlag {
3615 fn default() -> Self {
3616 Self::DEFAULT
3617 }
3618}
3619#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3621#[cfg_attr(feature = "serde", serde(tag = "type"))]
3622#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3623#[repr(u32)]
3624pub enum MavlinkDataStreamType {
3625 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3626 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3627 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3628 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3629 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3630 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3631}
3632impl MavlinkDataStreamType {
3633 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3634}
3635impl Default for MavlinkDataStreamType {
3636 fn default() -> Self {
3637 Self::DEFAULT
3638 }
3639}
3640#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3641#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3642#[cfg_attr(feature = "serde", serde(tag = "type"))]
3643#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3644#[repr(u32)]
3645#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3646pub enum MissionState {
3647 #[doc = "The mission status reporting is not supported."]
3648 MISSION_STATE_UNKNOWN = 0,
3649 #[doc = "No mission on the vehicle."]
3650 MISSION_STATE_NO_MISSION = 1,
3651 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3652 MISSION_STATE_NOT_STARTED = 2,
3653 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3654 MISSION_STATE_ACTIVE = 3,
3655 #[doc = "Mission is paused when in auto mode."]
3656 MISSION_STATE_PAUSED = 4,
3657 #[doc = "Mission has executed all mission items."]
3658 MISSION_STATE_COMPLETE = 5,
3659}
3660impl MissionState {
3661 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3662}
3663impl Default for MissionState {
3664 fn default() -> Self {
3665 Self::DEFAULT
3666 }
3667}
3668#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3669#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3670#[cfg_attr(feature = "serde", serde(tag = "type"))]
3671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3672#[repr(u32)]
3673#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3674pub enum MotorTestOrder {
3675 #[doc = "Default autopilot motor test method."]
3676 MOTOR_TEST_ORDER_DEFAULT = 0,
3677 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3678 MOTOR_TEST_ORDER_SEQUENCE = 1,
3679 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3680 MOTOR_TEST_ORDER_BOARD = 2,
3681}
3682impl MotorTestOrder {
3683 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3684}
3685impl Default for MotorTestOrder {
3686 fn default() -> Self {
3687 Self::DEFAULT
3688 }
3689}
3690#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3691#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3692#[cfg_attr(feature = "serde", serde(tag = "type"))]
3693#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3694#[repr(u32)]
3695#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3696pub enum MotorTestThrottleType {
3697 #[doc = "Throttle as a percentage (0 ~ 100)"]
3698 MOTOR_TEST_THROTTLE_PERCENT = 0,
3699 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3700 MOTOR_TEST_THROTTLE_PWM = 1,
3701 #[doc = "Throttle pass-through from pilot's transmitter."]
3702 MOTOR_TEST_THROTTLE_PILOT = 2,
3703 #[doc = "Per-motor compass calibration test."]
3704 MOTOR_TEST_COMPASS_CAL = 3,
3705}
3706impl MotorTestThrottleType {
3707 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3708}
3709impl Default for MotorTestThrottleType {
3710 fn default() -> Self {
3711 Self::DEFAULT
3712 }
3713}
3714#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3715#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3716#[cfg_attr(feature = "serde", serde(tag = "type"))]
3717#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3718#[repr(u32)]
3719pub enum NavVtolLandOptions {
3720 #[doc = "Default autopilot landing behaviour."]
3721 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3722 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3723 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3724 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3725 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3726}
3727impl NavVtolLandOptions {
3728 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3729}
3730impl Default for NavVtolLandOptions {
3731 fn default() -> Self {
3732 Self::DEFAULT
3733 }
3734}
3735#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3736#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3737#[cfg_attr(feature = "serde", serde(tag = "type"))]
3738#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3739#[repr(u32)]
3740#[doc = "Yaw behaviour during orbit flight."]
3741pub enum OrbitYawBehaviour {
3742 #[doc = "Vehicle front points to the center (default)."]
3743 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3744 #[doc = "Vehicle front holds heading when message received."]
3745 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3746 #[doc = "Yaw uncontrolled."]
3747 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3748 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3749 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3750 #[doc = "Yaw controlled by RC input."]
3751 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3752 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3753 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3754}
3755impl OrbitYawBehaviour {
3756 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3757}
3758impl Default for OrbitYawBehaviour {
3759 fn default() -> Self {
3760 Self::DEFAULT
3761 }
3762}
3763#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3764#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3765#[cfg_attr(feature = "serde", serde(tag = "type"))]
3766#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3767#[repr(u32)]
3768#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3769pub enum ParachuteAction {
3770 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3771 PARACHUTE_DISABLE = 0,
3772 #[doc = "Enable auto-release of parachute."]
3773 PARACHUTE_ENABLE = 1,
3774 #[doc = "Release parachute and kill motors."]
3775 PARACHUTE_RELEASE = 2,
3776}
3777impl ParachuteAction {
3778 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3779}
3780impl Default for ParachuteAction {
3781 fn default() -> Self {
3782 Self::DEFAULT
3783 }
3784}
3785#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3786#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3787#[cfg_attr(feature = "serde", serde(tag = "type"))]
3788#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3789#[repr(u32)]
3790#[doc = "Result from PARAM_EXT_SET message."]
3791pub enum ParamAck {
3792 #[doc = "Parameter value ACCEPTED and SET"]
3793 PARAM_ACK_ACCEPTED = 0,
3794 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3795 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3796 #[doc = "Parameter failed to set"]
3797 PARAM_ACK_FAILED = 2,
3798 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3799 PARAM_ACK_IN_PROGRESS = 3,
3800}
3801impl ParamAck {
3802 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3803}
3804impl Default for ParamAck {
3805 fn default() -> Self {
3806 Self::DEFAULT
3807 }
3808}
3809bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3810impl PositionTargetTypemask {
3811 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3812}
3813impl Default for PositionTargetTypemask {
3814 fn default() -> Self {
3815 Self::DEFAULT
3816 }
3817}
3818#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3819#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3820#[cfg_attr(feature = "serde", serde(tag = "type"))]
3821#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3822#[repr(u32)]
3823#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
3824pub enum PrecisionLandMode {
3825 #[doc = "Normal (non-precision) landing."]
3826 PRECISION_LAND_MODE_DISABLED = 0,
3827 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
3828 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
3829 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
3830 PRECISION_LAND_MODE_REQUIRED = 2,
3831}
3832impl PrecisionLandMode {
3833 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
3834}
3835impl Default for PrecisionLandMode {
3836 fn default() -> Self {
3837 Self::DEFAULT
3838 }
3839}
3840#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3841#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3842#[cfg_attr(feature = "serde", serde(tag = "type"))]
3843#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3844#[repr(u32)]
3845#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3846pub enum PreflightStorageMissionAction {
3847 #[doc = "Read current mission data from persistent storage"]
3848 MISSION_READ_PERSISTENT = 0,
3849 #[doc = "Write current mission data to persistent storage"]
3850 MISSION_WRITE_PERSISTENT = 1,
3851 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
3852 MISSION_RESET_DEFAULT = 2,
3853}
3854impl PreflightStorageMissionAction {
3855 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
3856}
3857impl Default for PreflightStorageMissionAction {
3858 fn default() -> Self {
3859 Self::DEFAULT
3860 }
3861}
3862#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3863#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3864#[cfg_attr(feature = "serde", serde(tag = "type"))]
3865#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3866#[repr(u32)]
3867#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3868pub enum PreflightStorageParameterAction {
3869 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
3870 PARAM_READ_PERSISTENT = 0,
3871 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
3872 PARAM_WRITE_PERSISTENT = 1,
3873 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
3874 PARAM_RESET_CONFIG_DEFAULT = 2,
3875 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
3876 PARAM_RESET_SENSOR_DEFAULT = 3,
3877 #[doc = "Reset all parameters, including operation counters, to default values"]
3878 PARAM_RESET_ALL_DEFAULT = 4,
3879}
3880impl PreflightStorageParameterAction {
3881 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
3882}
3883impl Default for PreflightStorageParameterAction {
3884 fn default() -> Self {
3885 Self::DEFAULT
3886 }
3887}
3888#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3889#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3890#[cfg_attr(feature = "serde", serde(tag = "type"))]
3891#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3892#[repr(u32)]
3893#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
3894pub enum RcSubType {
3895 #[doc = "Spektrum DSM2"]
3896 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
3897 #[doc = "Spektrum DSMX"]
3898 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
3899 #[doc = "Spektrum DSMX8"]
3900 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
3901}
3902impl RcSubType {
3903 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
3904}
3905impl Default for RcSubType {
3906 fn default() -> Self {
3907 Self::DEFAULT
3908 }
3909}
3910#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3911#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3912#[cfg_attr(feature = "serde", serde(tag = "type"))]
3913#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3914#[repr(u32)]
3915#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
3916pub enum RcType {
3917 #[doc = "Spektrum"]
3918 RC_TYPE_SPEKTRUM = 0,
3919 #[doc = "CRSF"]
3920 RC_TYPE_CRSF = 1,
3921}
3922impl RcType {
3923 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
3924}
3925impl Default for RcType {
3926 fn default() -> Self {
3927 Self::DEFAULT
3928 }
3929}
3930#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3931#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3932#[cfg_attr(feature = "serde", serde(tag = "type"))]
3933#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3934#[repr(u32)]
3935#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
3936pub enum RebootShutdownConditions {
3937 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
3938 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
3939 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
3940 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
3941}
3942impl RebootShutdownConditions {
3943 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
3944}
3945impl Default for RebootShutdownConditions {
3946 fn default() -> Self {
3947 Self::DEFAULT
3948 }
3949}
3950#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3951#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3952#[cfg_attr(feature = "serde", serde(tag = "type"))]
3953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3954#[repr(u32)]
3955#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
3956pub enum RtkBaselineCoordinateSystem {
3957 #[doc = "Earth-centered, Earth-fixed"]
3958 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
3959 #[doc = "RTK basestation centered, north, east, down"]
3960 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
3961}
3962impl RtkBaselineCoordinateSystem {
3963 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
3964}
3965impl Default for RtkBaselineCoordinateSystem {
3966 fn default() -> Self {
3967 Self::DEFAULT
3968 }
3969}
3970#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3971#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3972#[cfg_attr(feature = "serde", serde(tag = "type"))]
3973#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3974#[repr(u32)]
3975#[doc = "Possible safety switch states."]
3976pub enum SafetySwitchState {
3977 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
3978 SAFETY_SWITCH_STATE_SAFE = 0,
3979 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
3980 SAFETY_SWITCH_STATE_DANGEROUS = 1,
3981}
3982impl SafetySwitchState {
3983 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
3984}
3985impl Default for SafetySwitchState {
3986 fn default() -> Self {
3987 Self::DEFAULT
3988 }
3989}
3990#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3991#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3992#[cfg_attr(feature = "serde", serde(tag = "type"))]
3993#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3994#[repr(u32)]
3995#[doc = "SERIAL_CONTROL device types"]
3996pub enum SerialControlDev {
3997 #[doc = "First telemetry port"]
3998 SERIAL_CONTROL_DEV_TELEM1 = 0,
3999 #[doc = "Second telemetry port"]
4000 SERIAL_CONTROL_DEV_TELEM2 = 1,
4001 #[doc = "First GPS port"]
4002 SERIAL_CONTROL_DEV_GPS1 = 2,
4003 #[doc = "Second GPS port"]
4004 SERIAL_CONTROL_DEV_GPS2 = 3,
4005 #[doc = "system shell"]
4006 SERIAL_CONTROL_DEV_SHELL = 10,
4007 #[doc = "SERIAL0"]
4008 SERIAL_CONTROL_SERIAL0 = 100,
4009 #[doc = "SERIAL1"]
4010 SERIAL_CONTROL_SERIAL1 = 101,
4011 #[doc = "SERIAL2"]
4012 SERIAL_CONTROL_SERIAL2 = 102,
4013 #[doc = "SERIAL3"]
4014 SERIAL_CONTROL_SERIAL3 = 103,
4015 #[doc = "SERIAL4"]
4016 SERIAL_CONTROL_SERIAL4 = 104,
4017 #[doc = "SERIAL5"]
4018 SERIAL_CONTROL_SERIAL5 = 105,
4019 #[doc = "SERIAL6"]
4020 SERIAL_CONTROL_SERIAL6 = 106,
4021 #[doc = "SERIAL7"]
4022 SERIAL_CONTROL_SERIAL7 = 107,
4023 #[doc = "SERIAL8"]
4024 SERIAL_CONTROL_SERIAL8 = 108,
4025 #[doc = "SERIAL9"]
4026 SERIAL_CONTROL_SERIAL9 = 109,
4027}
4028impl SerialControlDev {
4029 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4030}
4031impl Default for SerialControlDev {
4032 fn default() -> Self {
4033 Self::DEFAULT
4034 }
4035}
4036bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4037impl SerialControlFlag {
4038 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4039}
4040impl Default for SerialControlFlag {
4041 fn default() -> Self {
4042 Self::DEFAULT
4043 }
4044}
4045#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4046#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4047#[cfg_attr(feature = "serde", serde(tag = "type"))]
4048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4049#[repr(u32)]
4050#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4051pub enum SetFocusType {
4052 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4053 FOCUS_TYPE_STEP = 0,
4054 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4055 FOCUS_TYPE_CONTINUOUS = 1,
4056 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4057 FOCUS_TYPE_RANGE = 2,
4058 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4059 FOCUS_TYPE_METERS = 3,
4060 #[doc = "Focus automatically."]
4061 FOCUS_TYPE_AUTO = 4,
4062 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4063 FOCUS_TYPE_AUTO_SINGLE = 5,
4064 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4065 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4066}
4067impl SetFocusType {
4068 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4069}
4070impl Default for SetFocusType {
4071 fn default() -> Self {
4072 Self::DEFAULT
4073 }
4074}
4075#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4076#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4077#[cfg_attr(feature = "serde", serde(tag = "type"))]
4078#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4079#[repr(u32)]
4080#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4081pub enum SpeedType {
4082 #[doc = "Airspeed"]
4083 SPEED_TYPE_AIRSPEED = 0,
4084 #[doc = "Groundspeed"]
4085 SPEED_TYPE_GROUNDSPEED = 1,
4086 #[doc = "Climb speed"]
4087 SPEED_TYPE_CLIMB_SPEED = 2,
4088 #[doc = "Descent speed"]
4089 SPEED_TYPE_DESCENT_SPEED = 3,
4090}
4091impl SpeedType {
4092 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4093}
4094impl Default for SpeedType {
4095 fn default() -> Self {
4096 Self::DEFAULT
4097 }
4098}
4099#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4100#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4101#[cfg_attr(feature = "serde", serde(tag = "type"))]
4102#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4103#[repr(u32)]
4104#[doc = "Flags to indicate the status of camera storage."]
4105pub enum StorageStatus {
4106 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4107 STORAGE_STATUS_EMPTY = 0,
4108 #[doc = "Storage present but unformatted."]
4109 STORAGE_STATUS_UNFORMATTED = 1,
4110 #[doc = "Storage present and ready."]
4111 STORAGE_STATUS_READY = 2,
4112 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4113 STORAGE_STATUS_NOT_SUPPORTED = 3,
4114}
4115impl StorageStatus {
4116 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4117}
4118impl Default for StorageStatus {
4119 fn default() -> Self {
4120 Self::DEFAULT
4121 }
4122}
4123#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4124#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4125#[cfg_attr(feature = "serde", serde(tag = "type"))]
4126#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4127#[repr(u32)]
4128#[doc = "Flags to indicate the type of storage."]
4129pub enum StorageType {
4130 #[doc = "Storage type is not known."]
4131 STORAGE_TYPE_UNKNOWN = 0,
4132 #[doc = "Storage type is USB device."]
4133 STORAGE_TYPE_USB_STICK = 1,
4134 #[doc = "Storage type is SD card."]
4135 STORAGE_TYPE_SD = 2,
4136 #[doc = "Storage type is microSD card."]
4137 STORAGE_TYPE_MICROSD = 3,
4138 #[doc = "Storage type is CFast."]
4139 STORAGE_TYPE_CF = 4,
4140 #[doc = "Storage type is CFexpress."]
4141 STORAGE_TYPE_CFE = 5,
4142 #[doc = "Storage type is XQD."]
4143 STORAGE_TYPE_XQD = 6,
4144 #[doc = "Storage type is HD mass storage type."]
4145 STORAGE_TYPE_HD = 7,
4146 #[doc = "Storage type is other, not listed type."]
4147 STORAGE_TYPE_OTHER = 254,
4148}
4149impl StorageType {
4150 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4151}
4152impl Default for StorageType {
4153 fn default() -> Self {
4154 Self::DEFAULT
4155 }
4156}
4157bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4158impl StorageUsageFlag {
4159 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4160}
4161impl Default for StorageUsageFlag {
4162 fn default() -> Self {
4163 Self::DEFAULT
4164 }
4165}
4166#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4168#[cfg_attr(feature = "serde", serde(tag = "type"))]
4169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4170#[repr(u32)]
4171#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4172pub enum TuneFormat {
4173 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4174 TUNE_FORMAT_QBASIC1_1 = 1,
4175 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4176 TUNE_FORMAT_MML_MODERN = 2,
4177}
4178impl TuneFormat {
4179 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4180}
4181impl Default for TuneFormat {
4182 fn default() -> Self {
4183 Self::DEFAULT
4184 }
4185}
4186#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4187#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4188#[cfg_attr(feature = "serde", serde(tag = "type"))]
4189#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4190#[repr(u32)]
4191#[doc = "Generalized UAVCAN node health"]
4192pub enum UavcanNodeHealth {
4193 #[doc = "The node is functioning properly."]
4194 UAVCAN_NODE_HEALTH_OK = 0,
4195 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4196 UAVCAN_NODE_HEALTH_WARNING = 1,
4197 #[doc = "The node has encountered a major failure."]
4198 UAVCAN_NODE_HEALTH_ERROR = 2,
4199 #[doc = "The node has suffered a fatal malfunction."]
4200 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4201}
4202impl UavcanNodeHealth {
4203 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4204}
4205impl Default for UavcanNodeHealth {
4206 fn default() -> Self {
4207 Self::DEFAULT
4208 }
4209}
4210#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4211#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4212#[cfg_attr(feature = "serde", serde(tag = "type"))]
4213#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4214#[repr(u32)]
4215#[doc = "Generalized UAVCAN node mode"]
4216pub enum UavcanNodeMode {
4217 #[doc = "The node is performing its primary functions."]
4218 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4219 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4220 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4221 #[doc = "The node is under maintenance."]
4222 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4223 #[doc = "The node is in the process of updating its software."]
4224 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4225 #[doc = "The node is no longer available online."]
4226 UAVCAN_NODE_MODE_OFFLINE = 7,
4227}
4228impl UavcanNodeMode {
4229 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4230}
4231impl Default for UavcanNodeMode {
4232 fn default() -> Self {
4233 Self::DEFAULT
4234 }
4235}
4236bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4237impl UtmDataAvailFlags {
4238 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4239}
4240impl Default for UtmDataAvailFlags {
4241 fn default() -> Self {
4242 Self::DEFAULT
4243 }
4244}
4245#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4246#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4247#[cfg_attr(feature = "serde", serde(tag = "type"))]
4248#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4249#[repr(u32)]
4250#[doc = "Airborne status of UAS."]
4251pub enum UtmFlightState {
4252 #[doc = "The flight state can't be determined."]
4253 UTM_FLIGHT_STATE_UNKNOWN = 1,
4254 #[doc = "UAS on ground."]
4255 UTM_FLIGHT_STATE_GROUND = 2,
4256 #[doc = "UAS airborne."]
4257 UTM_FLIGHT_STATE_AIRBORNE = 3,
4258 #[doc = "UAS is in an emergency flight state."]
4259 UTM_FLIGHT_STATE_EMERGENCY = 16,
4260 #[doc = "UAS has no active controls."]
4261 UTM_FLIGHT_STATE_NOCTRL = 32,
4262}
4263impl UtmFlightState {
4264 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4265}
4266impl Default for UtmFlightState {
4267 fn default() -> Self {
4268 Self::DEFAULT
4269 }
4270}
4271#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4272#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4273#[cfg_attr(feature = "serde", serde(tag = "type"))]
4274#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4275#[repr(u32)]
4276#[doc = "Video stream encodings"]
4277pub enum VideoStreamEncoding {
4278 #[doc = "Stream encoding is unknown"]
4279 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4280 #[doc = "Stream encoding is H.264"]
4281 VIDEO_STREAM_ENCODING_H264 = 1,
4282 #[doc = "Stream encoding is H.265"]
4283 VIDEO_STREAM_ENCODING_H265 = 2,
4284}
4285impl VideoStreamEncoding {
4286 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4287}
4288impl Default for VideoStreamEncoding {
4289 fn default() -> Self {
4290 Self::DEFAULT
4291 }
4292}
4293bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4294impl VideoStreamStatusFlags {
4295 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4296}
4297impl Default for VideoStreamStatusFlags {
4298 fn default() -> Self {
4299 Self::DEFAULT
4300 }
4301}
4302#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4304#[cfg_attr(feature = "serde", serde(tag = "type"))]
4305#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4306#[repr(u32)]
4307#[doc = "Video stream types"]
4308pub enum VideoStreamType {
4309 #[doc = "Stream is RTSP"]
4310 VIDEO_STREAM_TYPE_RTSP = 0,
4311 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4312 VIDEO_STREAM_TYPE_RTPUDP = 1,
4313 #[doc = "Stream is MPEG on TCP"]
4314 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4315 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4316 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4317}
4318impl VideoStreamType {
4319 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4320}
4321impl Default for VideoStreamType {
4322 fn default() -> Self {
4323 Self::DEFAULT
4324 }
4325}
4326#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4327#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4328#[cfg_attr(feature = "serde", serde(tag = "type"))]
4329#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4330#[repr(u32)]
4331#[doc = "Direction of VTOL transition"]
4332pub enum VtolTransitionHeading {
4333 #[doc = "Respect the heading configuration of the vehicle."]
4334 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4335 #[doc = "Use the heading pointing towards the next waypoint."]
4336 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4337 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4338 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4339 #[doc = "Use the specified heading in parameter 4."]
4340 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4341 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4342 VTOL_TRANSITION_HEADING_ANY = 4,
4343}
4344impl VtolTransitionHeading {
4345 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4346}
4347impl Default for VtolTransitionHeading {
4348 fn default() -> Self {
4349 Self::DEFAULT
4350 }
4351}
4352#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4353#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4354#[cfg_attr(feature = "serde", serde(tag = "type"))]
4355#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4356#[repr(u32)]
4357#[doc = "WiFi Mode."]
4358pub enum WifiConfigApMode {
4359 #[doc = "WiFi mode is undefined."]
4360 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4361 #[doc = "WiFi configured as an access point."]
4362 WIFI_CONFIG_AP_MODE_AP = 1,
4363 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4364 WIFI_CONFIG_AP_MODE_STATION = 2,
4365 #[doc = "WiFi disabled."]
4366 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4367}
4368impl WifiConfigApMode {
4369 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4370}
4371impl Default for WifiConfigApMode {
4372 fn default() -> Self {
4373 Self::DEFAULT
4374 }
4375}
4376#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4377#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4378#[cfg_attr(feature = "serde", serde(tag = "type"))]
4379#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4380#[repr(u32)]
4381#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4382pub enum WifiConfigApResponse {
4383 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4384 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4385 #[doc = "Changes accepted."]
4386 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4387 #[doc = "Changes rejected."]
4388 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4389 #[doc = "Invalid Mode."]
4390 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4391 #[doc = "Invalid SSID."]
4392 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4393 #[doc = "Invalid Password."]
4394 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4395}
4396impl WifiConfigApResponse {
4397 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4398}
4399impl Default for WifiConfigApResponse {
4400 fn default() -> Self {
4401 Self::DEFAULT
4402 }
4403}
4404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4406#[cfg_attr(feature = "serde", serde(tag = "type"))]
4407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4408#[repr(u32)]
4409#[doc = "Winch actions."]
4410pub enum WinchActions {
4411 #[doc = "Allow motor to freewheel."]
4412 WINCH_RELAXED = 0,
4413 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4414 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4415 #[doc = "Wind or unwind line at specified rate."]
4416 WINCH_RATE_CONTROL = 2,
4417 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4418 WINCH_LOCK = 3,
4419 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4420 WINCH_DELIVER = 4,
4421 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4422 WINCH_HOLD = 5,
4423 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4424 WINCH_RETRACT = 6,
4425 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4426 WINCH_LOAD_LINE = 7,
4427 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4428 WINCH_ABANDON_LINE = 8,
4429 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4430 WINCH_LOAD_PAYLOAD = 9,
4431}
4432impl WinchActions {
4433 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4434}
4435impl Default for WinchActions {
4436 fn default() -> Self {
4437 Self::DEFAULT
4438 }
4439}
4440#[doc = "Set the vehicle attitude and body angular rates."]
4441#[doc = ""]
4442#[doc = "ID: 140"]
4443#[derive(Debug, Clone, PartialEq)]
4444#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4445#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4446pub struct ACTUATOR_CONTROL_TARGET_DATA {
4447 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4448 pub time_usec: u64,
4449 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4450 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4451 pub controls: [f32; 8],
4452 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4453 pub group_mlx: u8,
4454}
4455impl ACTUATOR_CONTROL_TARGET_DATA {
4456 pub const ENCODED_LEN: usize = 41usize;
4457 pub const DEFAULT: Self = Self {
4458 time_usec: 0_u64,
4459 controls: [0.0_f32; 8usize],
4460 group_mlx: 0_u8,
4461 };
4462 #[cfg(feature = "arbitrary")]
4463 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4464 use arbitrary::{Arbitrary, Unstructured};
4465 let mut buf = [0u8; 1024];
4466 rng.fill_bytes(&mut buf);
4467 let mut unstructured = Unstructured::new(&buf);
4468 Self::arbitrary(&mut unstructured).unwrap_or_default()
4469 }
4470}
4471impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4472 fn default() -> Self {
4473 Self::DEFAULT.clone()
4474 }
4475}
4476impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4477 type Message = MavMessage;
4478 const ID: u32 = 140u32;
4479 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4480 const EXTRA_CRC: u8 = 181u8;
4481 const ENCODED_LEN: usize = 41usize;
4482 fn deser(
4483 _version: MavlinkVersion,
4484 __input: &[u8],
4485 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4486 let avail_len = __input.len();
4487 let mut payload_buf = [0; Self::ENCODED_LEN];
4488 let mut buf = if avail_len < Self::ENCODED_LEN {
4489 payload_buf[0..avail_len].copy_from_slice(__input);
4490 Bytes::new(&payload_buf)
4491 } else {
4492 Bytes::new(__input)
4493 };
4494 let mut __struct = Self::default();
4495 __struct.time_usec = buf.get_u64_le();
4496 for v in &mut __struct.controls {
4497 let val = buf.get_f32_le();
4498 *v = val;
4499 }
4500 __struct.group_mlx = buf.get_u8();
4501 Ok(__struct)
4502 }
4503 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4504 let mut __tmp = BytesMut::new(bytes);
4505 #[allow(clippy::absurd_extreme_comparisons)]
4506 #[allow(unused_comparisons)]
4507 if __tmp.remaining() < Self::ENCODED_LEN {
4508 panic!(
4509 "buffer is too small (need {} bytes, but got {})",
4510 Self::ENCODED_LEN,
4511 __tmp.remaining(),
4512 )
4513 }
4514 __tmp.put_u64_le(self.time_usec);
4515 for val in &self.controls {
4516 __tmp.put_f32_le(*val);
4517 }
4518 __tmp.put_u8(self.group_mlx);
4519 if matches!(version, MavlinkVersion::V2) {
4520 let len = __tmp.len();
4521 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4522 } else {
4523 __tmp.len()
4524 }
4525 }
4526}
4527#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4528#[doc = ""]
4529#[doc = "ID: 375"]
4530#[derive(Debug, Clone, PartialEq)]
4531#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4533pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4534 #[doc = "Timestamp (since system boot)."]
4535 pub time_usec: u64,
4536 #[doc = "Active outputs"]
4537 pub active: u32,
4538 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4539 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4540 pub actuator: [f32; 32],
4541}
4542impl ACTUATOR_OUTPUT_STATUS_DATA {
4543 pub const ENCODED_LEN: usize = 140usize;
4544 pub const DEFAULT: Self = Self {
4545 time_usec: 0_u64,
4546 active: 0_u32,
4547 actuator: [0.0_f32; 32usize],
4548 };
4549 #[cfg(feature = "arbitrary")]
4550 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4551 use arbitrary::{Arbitrary, Unstructured};
4552 let mut buf = [0u8; 1024];
4553 rng.fill_bytes(&mut buf);
4554 let mut unstructured = Unstructured::new(&buf);
4555 Self::arbitrary(&mut unstructured).unwrap_or_default()
4556 }
4557}
4558impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4559 fn default() -> Self {
4560 Self::DEFAULT.clone()
4561 }
4562}
4563impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4564 type Message = MavMessage;
4565 const ID: u32 = 375u32;
4566 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4567 const EXTRA_CRC: u8 = 251u8;
4568 const ENCODED_LEN: usize = 140usize;
4569 fn deser(
4570 _version: MavlinkVersion,
4571 __input: &[u8],
4572 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4573 let avail_len = __input.len();
4574 let mut payload_buf = [0; Self::ENCODED_LEN];
4575 let mut buf = if avail_len < Self::ENCODED_LEN {
4576 payload_buf[0..avail_len].copy_from_slice(__input);
4577 Bytes::new(&payload_buf)
4578 } else {
4579 Bytes::new(__input)
4580 };
4581 let mut __struct = Self::default();
4582 __struct.time_usec = buf.get_u64_le();
4583 __struct.active = buf.get_u32_le();
4584 for v in &mut __struct.actuator {
4585 let val = buf.get_f32_le();
4586 *v = val;
4587 }
4588 Ok(__struct)
4589 }
4590 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4591 let mut __tmp = BytesMut::new(bytes);
4592 #[allow(clippy::absurd_extreme_comparisons)]
4593 #[allow(unused_comparisons)]
4594 if __tmp.remaining() < Self::ENCODED_LEN {
4595 panic!(
4596 "buffer is too small (need {} bytes, but got {})",
4597 Self::ENCODED_LEN,
4598 __tmp.remaining(),
4599 )
4600 }
4601 __tmp.put_u64_le(self.time_usec);
4602 __tmp.put_u32_le(self.active);
4603 for val in &self.actuator {
4604 __tmp.put_f32_le(*val);
4605 }
4606 if matches!(version, MavlinkVersion::V2) {
4607 let len = __tmp.len();
4608 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4609 } else {
4610 __tmp.len()
4611 }
4612 }
4613}
4614#[doc = "The location and information of an ADSB vehicle."]
4615#[doc = ""]
4616#[doc = "ID: 246"]
4617#[derive(Debug, Clone, PartialEq)]
4618#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4619#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4620pub struct ADSB_VEHICLE_DATA {
4621 #[doc = "ICAO address"]
4622 pub ICAO_address: u32,
4623 #[doc = "Latitude"]
4624 pub lat: i32,
4625 #[doc = "Longitude"]
4626 pub lon: i32,
4627 #[doc = "Altitude(ASL)"]
4628 pub altitude: i32,
4629 #[doc = "Course over ground"]
4630 pub heading: u16,
4631 #[doc = "The horizontal velocity"]
4632 pub hor_velocity: u16,
4633 #[doc = "The vertical velocity. Positive is up"]
4634 pub ver_velocity: i16,
4635 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4636 pub flags: AdsbFlags,
4637 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4638 pub squawk: u16,
4639 #[doc = "ADSB altitude type."]
4640 pub altitude_type: AdsbAltitudeType,
4641 #[doc = "The callsign, 8+null"]
4642 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4643 pub callsign: [u8; 9],
4644 #[doc = "ADSB emitter type."]
4645 pub emitter_type: AdsbEmitterType,
4646 #[doc = "Time since last communication in seconds"]
4647 pub tslc: u8,
4648}
4649impl ADSB_VEHICLE_DATA {
4650 pub const ENCODED_LEN: usize = 38usize;
4651 pub const DEFAULT: Self = Self {
4652 ICAO_address: 0_u32,
4653 lat: 0_i32,
4654 lon: 0_i32,
4655 altitude: 0_i32,
4656 heading: 0_u16,
4657 hor_velocity: 0_u16,
4658 ver_velocity: 0_i16,
4659 flags: AdsbFlags::DEFAULT,
4660 squawk: 0_u16,
4661 altitude_type: AdsbAltitudeType::DEFAULT,
4662 callsign: [0_u8; 9usize],
4663 emitter_type: AdsbEmitterType::DEFAULT,
4664 tslc: 0_u8,
4665 };
4666 #[cfg(feature = "arbitrary")]
4667 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4668 use arbitrary::{Arbitrary, Unstructured};
4669 let mut buf = [0u8; 1024];
4670 rng.fill_bytes(&mut buf);
4671 let mut unstructured = Unstructured::new(&buf);
4672 Self::arbitrary(&mut unstructured).unwrap_or_default()
4673 }
4674}
4675impl Default for ADSB_VEHICLE_DATA {
4676 fn default() -> Self {
4677 Self::DEFAULT.clone()
4678 }
4679}
4680impl MessageData for ADSB_VEHICLE_DATA {
4681 type Message = MavMessage;
4682 const ID: u32 = 246u32;
4683 const NAME: &'static str = "ADSB_VEHICLE";
4684 const EXTRA_CRC: u8 = 184u8;
4685 const ENCODED_LEN: usize = 38usize;
4686 fn deser(
4687 _version: MavlinkVersion,
4688 __input: &[u8],
4689 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4690 let avail_len = __input.len();
4691 let mut payload_buf = [0; Self::ENCODED_LEN];
4692 let mut buf = if avail_len < Self::ENCODED_LEN {
4693 payload_buf[0..avail_len].copy_from_slice(__input);
4694 Bytes::new(&payload_buf)
4695 } else {
4696 Bytes::new(__input)
4697 };
4698 let mut __struct = Self::default();
4699 __struct.ICAO_address = buf.get_u32_le();
4700 __struct.lat = buf.get_i32_le();
4701 __struct.lon = buf.get_i32_le();
4702 __struct.altitude = buf.get_i32_le();
4703 __struct.heading = buf.get_u16_le();
4704 __struct.hor_velocity = buf.get_u16_le();
4705 __struct.ver_velocity = buf.get_i16_le();
4706 let tmp = buf.get_u16_le();
4707 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4708 ::mavlink_core::error::ParserError::InvalidFlag {
4709 flag_type: "AdsbFlags",
4710 value: tmp as u32,
4711 },
4712 )?;
4713 __struct.squawk = buf.get_u16_le();
4714 let tmp = buf.get_u8();
4715 __struct.altitude_type =
4716 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4717 enum_type: "AdsbAltitudeType",
4718 value: tmp as u32,
4719 })?;
4720 for v in &mut __struct.callsign {
4721 let val = buf.get_u8();
4722 *v = val;
4723 }
4724 let tmp = buf.get_u8();
4725 __struct.emitter_type =
4726 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4727 enum_type: "AdsbEmitterType",
4728 value: tmp as u32,
4729 })?;
4730 __struct.tslc = buf.get_u8();
4731 Ok(__struct)
4732 }
4733 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4734 let mut __tmp = BytesMut::new(bytes);
4735 #[allow(clippy::absurd_extreme_comparisons)]
4736 #[allow(unused_comparisons)]
4737 if __tmp.remaining() < Self::ENCODED_LEN {
4738 panic!(
4739 "buffer is too small (need {} bytes, but got {})",
4740 Self::ENCODED_LEN,
4741 __tmp.remaining(),
4742 )
4743 }
4744 __tmp.put_u32_le(self.ICAO_address);
4745 __tmp.put_i32_le(self.lat);
4746 __tmp.put_i32_le(self.lon);
4747 __tmp.put_i32_le(self.altitude);
4748 __tmp.put_u16_le(self.heading);
4749 __tmp.put_u16_le(self.hor_velocity);
4750 __tmp.put_i16_le(self.ver_velocity);
4751 __tmp.put_u16_le(self.flags.bits());
4752 __tmp.put_u16_le(self.squawk);
4753 __tmp.put_u8(self.altitude_type as u8);
4754 for val in &self.callsign {
4755 __tmp.put_u8(*val);
4756 }
4757 __tmp.put_u8(self.emitter_type as u8);
4758 __tmp.put_u8(self.tslc);
4759 if matches!(version, MavlinkVersion::V2) {
4760 let len = __tmp.len();
4761 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4762 } else {
4763 __tmp.len()
4764 }
4765 }
4766}
4767#[doc = "The location and information of an AIS vessel."]
4768#[doc = ""]
4769#[doc = "ID: 301"]
4770#[derive(Debug, Clone, PartialEq)]
4771#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4772#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4773pub struct AIS_VESSEL_DATA {
4774 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
4775 pub MMSI: u32,
4776 #[doc = "Latitude"]
4777 pub lat: i32,
4778 #[doc = "Longitude"]
4779 pub lon: i32,
4780 #[doc = "Course over ground"]
4781 pub COG: u16,
4782 #[doc = "True heading"]
4783 pub heading: u16,
4784 #[doc = "Speed over ground"]
4785 pub velocity: u16,
4786 #[doc = "Distance from lat/lon location to bow"]
4787 pub dimension_bow: u16,
4788 #[doc = "Distance from lat/lon location to stern"]
4789 pub dimension_stern: u16,
4790 #[doc = "Time since last communication in seconds"]
4791 pub tslc: u16,
4792 #[doc = "Bitmask to indicate various statuses including valid data fields"]
4793 pub flags: AisFlags,
4794 #[doc = "Turn rate"]
4795 pub turn_rate: i8,
4796 #[doc = "Navigational status"]
4797 pub navigational_status: AisNavStatus,
4798 #[doc = "Type of vessels"]
4799 pub mavtype: AisType,
4800 #[doc = "Distance from lat/lon location to port side"]
4801 pub dimension_port: u8,
4802 #[doc = "Distance from lat/lon location to starboard side"]
4803 pub dimension_starboard: u8,
4804 #[doc = "The vessel callsign"]
4805 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4806 pub callsign: [u8; 7],
4807 #[doc = "The vessel name"]
4808 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4809 pub name: [u8; 20],
4810}
4811impl AIS_VESSEL_DATA {
4812 pub const ENCODED_LEN: usize = 58usize;
4813 pub const DEFAULT: Self = Self {
4814 MMSI: 0_u32,
4815 lat: 0_i32,
4816 lon: 0_i32,
4817 COG: 0_u16,
4818 heading: 0_u16,
4819 velocity: 0_u16,
4820 dimension_bow: 0_u16,
4821 dimension_stern: 0_u16,
4822 tslc: 0_u16,
4823 flags: AisFlags::DEFAULT,
4824 turn_rate: 0_i8,
4825 navigational_status: AisNavStatus::DEFAULT,
4826 mavtype: AisType::DEFAULT,
4827 dimension_port: 0_u8,
4828 dimension_starboard: 0_u8,
4829 callsign: [0_u8; 7usize],
4830 name: [0_u8; 20usize],
4831 };
4832 #[cfg(feature = "arbitrary")]
4833 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4834 use arbitrary::{Arbitrary, Unstructured};
4835 let mut buf = [0u8; 1024];
4836 rng.fill_bytes(&mut buf);
4837 let mut unstructured = Unstructured::new(&buf);
4838 Self::arbitrary(&mut unstructured).unwrap_or_default()
4839 }
4840}
4841impl Default for AIS_VESSEL_DATA {
4842 fn default() -> Self {
4843 Self::DEFAULT.clone()
4844 }
4845}
4846impl MessageData for AIS_VESSEL_DATA {
4847 type Message = MavMessage;
4848 const ID: u32 = 301u32;
4849 const NAME: &'static str = "AIS_VESSEL";
4850 const EXTRA_CRC: u8 = 243u8;
4851 const ENCODED_LEN: usize = 58usize;
4852 fn deser(
4853 _version: MavlinkVersion,
4854 __input: &[u8],
4855 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4856 let avail_len = __input.len();
4857 let mut payload_buf = [0; Self::ENCODED_LEN];
4858 let mut buf = if avail_len < Self::ENCODED_LEN {
4859 payload_buf[0..avail_len].copy_from_slice(__input);
4860 Bytes::new(&payload_buf)
4861 } else {
4862 Bytes::new(__input)
4863 };
4864 let mut __struct = Self::default();
4865 __struct.MMSI = buf.get_u32_le();
4866 __struct.lat = buf.get_i32_le();
4867 __struct.lon = buf.get_i32_le();
4868 __struct.COG = buf.get_u16_le();
4869 __struct.heading = buf.get_u16_le();
4870 __struct.velocity = buf.get_u16_le();
4871 __struct.dimension_bow = buf.get_u16_le();
4872 __struct.dimension_stern = buf.get_u16_le();
4873 __struct.tslc = buf.get_u16_le();
4874 let tmp = buf.get_u16_le();
4875 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
4876 ::mavlink_core::error::ParserError::InvalidFlag {
4877 flag_type: "AisFlags",
4878 value: tmp as u32,
4879 },
4880 )?;
4881 __struct.turn_rate = buf.get_i8();
4882 let tmp = buf.get_u8();
4883 __struct.navigational_status =
4884 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4885 enum_type: "AisNavStatus",
4886 value: tmp as u32,
4887 })?;
4888 let tmp = buf.get_u8();
4889 __struct.mavtype =
4890 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4891 enum_type: "AisType",
4892 value: tmp as u32,
4893 })?;
4894 __struct.dimension_port = buf.get_u8();
4895 __struct.dimension_starboard = buf.get_u8();
4896 for v in &mut __struct.callsign {
4897 let val = buf.get_u8();
4898 *v = val;
4899 }
4900 for v in &mut __struct.name {
4901 let val = buf.get_u8();
4902 *v = val;
4903 }
4904 Ok(__struct)
4905 }
4906 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4907 let mut __tmp = BytesMut::new(bytes);
4908 #[allow(clippy::absurd_extreme_comparisons)]
4909 #[allow(unused_comparisons)]
4910 if __tmp.remaining() < Self::ENCODED_LEN {
4911 panic!(
4912 "buffer is too small (need {} bytes, but got {})",
4913 Self::ENCODED_LEN,
4914 __tmp.remaining(),
4915 )
4916 }
4917 __tmp.put_u32_le(self.MMSI);
4918 __tmp.put_i32_le(self.lat);
4919 __tmp.put_i32_le(self.lon);
4920 __tmp.put_u16_le(self.COG);
4921 __tmp.put_u16_le(self.heading);
4922 __tmp.put_u16_le(self.velocity);
4923 __tmp.put_u16_le(self.dimension_bow);
4924 __tmp.put_u16_le(self.dimension_stern);
4925 __tmp.put_u16_le(self.tslc);
4926 __tmp.put_u16_le(self.flags.bits());
4927 __tmp.put_i8(self.turn_rate);
4928 __tmp.put_u8(self.navigational_status as u8);
4929 __tmp.put_u8(self.mavtype as u8);
4930 __tmp.put_u8(self.dimension_port);
4931 __tmp.put_u8(self.dimension_starboard);
4932 for val in &self.callsign {
4933 __tmp.put_u8(*val);
4934 }
4935 for val in &self.name {
4936 __tmp.put_u8(*val);
4937 }
4938 if matches!(version, MavlinkVersion::V2) {
4939 let len = __tmp.len();
4940 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4941 } else {
4942 __tmp.len()
4943 }
4944 }
4945}
4946#[doc = "The current system altitude."]
4947#[doc = ""]
4948#[doc = "ID: 141"]
4949#[derive(Debug, Clone, PartialEq)]
4950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4952pub struct ALTITUDE_DATA {
4953 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4954 pub time_usec: u64,
4955 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
4956 pub altitude_monotonic: f32,
4957 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
4958 pub altitude_amsl: f32,
4959 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
4960 pub altitude_local: f32,
4961 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
4962 pub altitude_relative: f32,
4963 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
4964 pub altitude_terrain: f32,
4965 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
4966 pub bottom_clearance: f32,
4967}
4968impl ALTITUDE_DATA {
4969 pub const ENCODED_LEN: usize = 32usize;
4970 pub const DEFAULT: Self = Self {
4971 time_usec: 0_u64,
4972 altitude_monotonic: 0.0_f32,
4973 altitude_amsl: 0.0_f32,
4974 altitude_local: 0.0_f32,
4975 altitude_relative: 0.0_f32,
4976 altitude_terrain: 0.0_f32,
4977 bottom_clearance: 0.0_f32,
4978 };
4979 #[cfg(feature = "arbitrary")]
4980 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4981 use arbitrary::{Arbitrary, Unstructured};
4982 let mut buf = [0u8; 1024];
4983 rng.fill_bytes(&mut buf);
4984 let mut unstructured = Unstructured::new(&buf);
4985 Self::arbitrary(&mut unstructured).unwrap_or_default()
4986 }
4987}
4988impl Default for ALTITUDE_DATA {
4989 fn default() -> Self {
4990 Self::DEFAULT.clone()
4991 }
4992}
4993impl MessageData for ALTITUDE_DATA {
4994 type Message = MavMessage;
4995 const ID: u32 = 141u32;
4996 const NAME: &'static str = "ALTITUDE";
4997 const EXTRA_CRC: u8 = 47u8;
4998 const ENCODED_LEN: usize = 32usize;
4999 fn deser(
5000 _version: MavlinkVersion,
5001 __input: &[u8],
5002 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5003 let avail_len = __input.len();
5004 let mut payload_buf = [0; Self::ENCODED_LEN];
5005 let mut buf = if avail_len < Self::ENCODED_LEN {
5006 payload_buf[0..avail_len].copy_from_slice(__input);
5007 Bytes::new(&payload_buf)
5008 } else {
5009 Bytes::new(__input)
5010 };
5011 let mut __struct = Self::default();
5012 __struct.time_usec = buf.get_u64_le();
5013 __struct.altitude_monotonic = buf.get_f32_le();
5014 __struct.altitude_amsl = buf.get_f32_le();
5015 __struct.altitude_local = buf.get_f32_le();
5016 __struct.altitude_relative = buf.get_f32_le();
5017 __struct.altitude_terrain = buf.get_f32_le();
5018 __struct.bottom_clearance = buf.get_f32_le();
5019 Ok(__struct)
5020 }
5021 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5022 let mut __tmp = BytesMut::new(bytes);
5023 #[allow(clippy::absurd_extreme_comparisons)]
5024 #[allow(unused_comparisons)]
5025 if __tmp.remaining() < Self::ENCODED_LEN {
5026 panic!(
5027 "buffer is too small (need {} bytes, but got {})",
5028 Self::ENCODED_LEN,
5029 __tmp.remaining(),
5030 )
5031 }
5032 __tmp.put_u64_le(self.time_usec);
5033 __tmp.put_f32_le(self.altitude_monotonic);
5034 __tmp.put_f32_le(self.altitude_amsl);
5035 __tmp.put_f32_le(self.altitude_local);
5036 __tmp.put_f32_le(self.altitude_relative);
5037 __tmp.put_f32_le(self.altitude_terrain);
5038 __tmp.put_f32_le(self.bottom_clearance);
5039 if matches!(version, MavlinkVersion::V2) {
5040 let len = __tmp.len();
5041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5042 } else {
5043 __tmp.len()
5044 }
5045 }
5046}
5047#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5048#[doc = ""]
5049#[doc = "ID: 30"]
5050#[derive(Debug, Clone, PartialEq)]
5051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5053pub struct ATTITUDE_DATA {
5054 #[doc = "Timestamp (time since system boot)."]
5055 pub time_boot_ms: u32,
5056 #[doc = "Roll angle (-pi..+pi)"]
5057 pub roll: f32,
5058 #[doc = "Pitch angle (-pi..+pi)"]
5059 pub pitch: f32,
5060 #[doc = "Yaw angle (-pi..+pi)"]
5061 pub yaw: f32,
5062 #[doc = "Roll angular speed"]
5063 pub rollspeed: f32,
5064 #[doc = "Pitch angular speed"]
5065 pub pitchspeed: f32,
5066 #[doc = "Yaw angular speed"]
5067 pub yawspeed: f32,
5068}
5069impl ATTITUDE_DATA {
5070 pub const ENCODED_LEN: usize = 28usize;
5071 pub const DEFAULT: Self = Self {
5072 time_boot_ms: 0_u32,
5073 roll: 0.0_f32,
5074 pitch: 0.0_f32,
5075 yaw: 0.0_f32,
5076 rollspeed: 0.0_f32,
5077 pitchspeed: 0.0_f32,
5078 yawspeed: 0.0_f32,
5079 };
5080 #[cfg(feature = "arbitrary")]
5081 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5082 use arbitrary::{Arbitrary, Unstructured};
5083 let mut buf = [0u8; 1024];
5084 rng.fill_bytes(&mut buf);
5085 let mut unstructured = Unstructured::new(&buf);
5086 Self::arbitrary(&mut unstructured).unwrap_or_default()
5087 }
5088}
5089impl Default for ATTITUDE_DATA {
5090 fn default() -> Self {
5091 Self::DEFAULT.clone()
5092 }
5093}
5094impl MessageData for ATTITUDE_DATA {
5095 type Message = MavMessage;
5096 const ID: u32 = 30u32;
5097 const NAME: &'static str = "ATTITUDE";
5098 const EXTRA_CRC: u8 = 39u8;
5099 const ENCODED_LEN: usize = 28usize;
5100 fn deser(
5101 _version: MavlinkVersion,
5102 __input: &[u8],
5103 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5104 let avail_len = __input.len();
5105 let mut payload_buf = [0; Self::ENCODED_LEN];
5106 let mut buf = if avail_len < Self::ENCODED_LEN {
5107 payload_buf[0..avail_len].copy_from_slice(__input);
5108 Bytes::new(&payload_buf)
5109 } else {
5110 Bytes::new(__input)
5111 };
5112 let mut __struct = Self::default();
5113 __struct.time_boot_ms = buf.get_u32_le();
5114 __struct.roll = buf.get_f32_le();
5115 __struct.pitch = buf.get_f32_le();
5116 __struct.yaw = buf.get_f32_le();
5117 __struct.rollspeed = buf.get_f32_le();
5118 __struct.pitchspeed = buf.get_f32_le();
5119 __struct.yawspeed = buf.get_f32_le();
5120 Ok(__struct)
5121 }
5122 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5123 let mut __tmp = BytesMut::new(bytes);
5124 #[allow(clippy::absurd_extreme_comparisons)]
5125 #[allow(unused_comparisons)]
5126 if __tmp.remaining() < Self::ENCODED_LEN {
5127 panic!(
5128 "buffer is too small (need {} bytes, but got {})",
5129 Self::ENCODED_LEN,
5130 __tmp.remaining(),
5131 )
5132 }
5133 __tmp.put_u32_le(self.time_boot_ms);
5134 __tmp.put_f32_le(self.roll);
5135 __tmp.put_f32_le(self.pitch);
5136 __tmp.put_f32_le(self.yaw);
5137 __tmp.put_f32_le(self.rollspeed);
5138 __tmp.put_f32_le(self.pitchspeed);
5139 __tmp.put_f32_le(self.yawspeed);
5140 if matches!(version, MavlinkVersion::V2) {
5141 let len = __tmp.len();
5142 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5143 } else {
5144 __tmp.len()
5145 }
5146 }
5147}
5148#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5149#[doc = ""]
5150#[doc = "ID: 31"]
5151#[derive(Debug, Clone, PartialEq)]
5152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5153#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5154pub struct ATTITUDE_QUATERNION_DATA {
5155 #[doc = "Timestamp (time since system boot)."]
5156 pub time_boot_ms: u32,
5157 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5158 pub q1: f32,
5159 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5160 pub q2: f32,
5161 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5162 pub q3: f32,
5163 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5164 pub q4: f32,
5165 #[doc = "Roll angular speed"]
5166 pub rollspeed: f32,
5167 #[doc = "Pitch angular speed"]
5168 pub pitchspeed: f32,
5169 #[doc = "Yaw angular speed"]
5170 pub yawspeed: f32,
5171 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5172 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5173 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5174 pub repr_offset_q: [f32; 4],
5175}
5176impl ATTITUDE_QUATERNION_DATA {
5177 pub const ENCODED_LEN: usize = 48usize;
5178 pub const DEFAULT: Self = Self {
5179 time_boot_ms: 0_u32,
5180 q1: 0.0_f32,
5181 q2: 0.0_f32,
5182 q3: 0.0_f32,
5183 q4: 0.0_f32,
5184 rollspeed: 0.0_f32,
5185 pitchspeed: 0.0_f32,
5186 yawspeed: 0.0_f32,
5187 repr_offset_q: [0.0_f32; 4usize],
5188 };
5189 #[cfg(feature = "arbitrary")]
5190 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5191 use arbitrary::{Arbitrary, Unstructured};
5192 let mut buf = [0u8; 1024];
5193 rng.fill_bytes(&mut buf);
5194 let mut unstructured = Unstructured::new(&buf);
5195 Self::arbitrary(&mut unstructured).unwrap_or_default()
5196 }
5197}
5198impl Default for ATTITUDE_QUATERNION_DATA {
5199 fn default() -> Self {
5200 Self::DEFAULT.clone()
5201 }
5202}
5203impl MessageData for ATTITUDE_QUATERNION_DATA {
5204 type Message = MavMessage;
5205 const ID: u32 = 31u32;
5206 const NAME: &'static str = "ATTITUDE_QUATERNION";
5207 const EXTRA_CRC: u8 = 246u8;
5208 const ENCODED_LEN: usize = 48usize;
5209 fn deser(
5210 _version: MavlinkVersion,
5211 __input: &[u8],
5212 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5213 let avail_len = __input.len();
5214 let mut payload_buf = [0; Self::ENCODED_LEN];
5215 let mut buf = if avail_len < Self::ENCODED_LEN {
5216 payload_buf[0..avail_len].copy_from_slice(__input);
5217 Bytes::new(&payload_buf)
5218 } else {
5219 Bytes::new(__input)
5220 };
5221 let mut __struct = Self::default();
5222 __struct.time_boot_ms = buf.get_u32_le();
5223 __struct.q1 = buf.get_f32_le();
5224 __struct.q2 = buf.get_f32_le();
5225 __struct.q3 = buf.get_f32_le();
5226 __struct.q4 = buf.get_f32_le();
5227 __struct.rollspeed = buf.get_f32_le();
5228 __struct.pitchspeed = buf.get_f32_le();
5229 __struct.yawspeed = buf.get_f32_le();
5230 for v in &mut __struct.repr_offset_q {
5231 let val = buf.get_f32_le();
5232 *v = val;
5233 }
5234 Ok(__struct)
5235 }
5236 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5237 let mut __tmp = BytesMut::new(bytes);
5238 #[allow(clippy::absurd_extreme_comparisons)]
5239 #[allow(unused_comparisons)]
5240 if __tmp.remaining() < Self::ENCODED_LEN {
5241 panic!(
5242 "buffer is too small (need {} bytes, but got {})",
5243 Self::ENCODED_LEN,
5244 __tmp.remaining(),
5245 )
5246 }
5247 __tmp.put_u32_le(self.time_boot_ms);
5248 __tmp.put_f32_le(self.q1);
5249 __tmp.put_f32_le(self.q2);
5250 __tmp.put_f32_le(self.q3);
5251 __tmp.put_f32_le(self.q4);
5252 __tmp.put_f32_le(self.rollspeed);
5253 __tmp.put_f32_le(self.pitchspeed);
5254 __tmp.put_f32_le(self.yawspeed);
5255 if matches!(version, MavlinkVersion::V2) {
5256 for val in &self.repr_offset_q {
5257 __tmp.put_f32_le(*val);
5258 }
5259 let len = __tmp.len();
5260 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5261 } else {
5262 __tmp.len()
5263 }
5264 }
5265}
5266#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5267#[doc = ""]
5268#[doc = "ID: 61"]
5269#[derive(Debug, Clone, PartialEq)]
5270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5272pub struct ATTITUDE_QUATERNION_COV_DATA {
5273 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5274 pub time_usec: u64,
5275 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5276 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5277 pub q: [f32; 4],
5278 #[doc = "Roll angular speed"]
5279 pub rollspeed: f32,
5280 #[doc = "Pitch angular speed"]
5281 pub pitchspeed: f32,
5282 #[doc = "Yaw angular speed"]
5283 pub yawspeed: f32,
5284 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5285 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5286 pub covariance: [f32; 9],
5287}
5288impl ATTITUDE_QUATERNION_COV_DATA {
5289 pub const ENCODED_LEN: usize = 72usize;
5290 pub const DEFAULT: Self = Self {
5291 time_usec: 0_u64,
5292 q: [0.0_f32; 4usize],
5293 rollspeed: 0.0_f32,
5294 pitchspeed: 0.0_f32,
5295 yawspeed: 0.0_f32,
5296 covariance: [0.0_f32; 9usize],
5297 };
5298 #[cfg(feature = "arbitrary")]
5299 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5300 use arbitrary::{Arbitrary, Unstructured};
5301 let mut buf = [0u8; 1024];
5302 rng.fill_bytes(&mut buf);
5303 let mut unstructured = Unstructured::new(&buf);
5304 Self::arbitrary(&mut unstructured).unwrap_or_default()
5305 }
5306}
5307impl Default for ATTITUDE_QUATERNION_COV_DATA {
5308 fn default() -> Self {
5309 Self::DEFAULT.clone()
5310 }
5311}
5312impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5313 type Message = MavMessage;
5314 const ID: u32 = 61u32;
5315 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5316 const EXTRA_CRC: u8 = 167u8;
5317 const ENCODED_LEN: usize = 72usize;
5318 fn deser(
5319 _version: MavlinkVersion,
5320 __input: &[u8],
5321 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5322 let avail_len = __input.len();
5323 let mut payload_buf = [0; Self::ENCODED_LEN];
5324 let mut buf = if avail_len < Self::ENCODED_LEN {
5325 payload_buf[0..avail_len].copy_from_slice(__input);
5326 Bytes::new(&payload_buf)
5327 } else {
5328 Bytes::new(__input)
5329 };
5330 let mut __struct = Self::default();
5331 __struct.time_usec = buf.get_u64_le();
5332 for v in &mut __struct.q {
5333 let val = buf.get_f32_le();
5334 *v = val;
5335 }
5336 __struct.rollspeed = buf.get_f32_le();
5337 __struct.pitchspeed = buf.get_f32_le();
5338 __struct.yawspeed = buf.get_f32_le();
5339 for v in &mut __struct.covariance {
5340 let val = buf.get_f32_le();
5341 *v = val;
5342 }
5343 Ok(__struct)
5344 }
5345 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5346 let mut __tmp = BytesMut::new(bytes);
5347 #[allow(clippy::absurd_extreme_comparisons)]
5348 #[allow(unused_comparisons)]
5349 if __tmp.remaining() < Self::ENCODED_LEN {
5350 panic!(
5351 "buffer is too small (need {} bytes, but got {})",
5352 Self::ENCODED_LEN,
5353 __tmp.remaining(),
5354 )
5355 }
5356 __tmp.put_u64_le(self.time_usec);
5357 for val in &self.q {
5358 __tmp.put_f32_le(*val);
5359 }
5360 __tmp.put_f32_le(self.rollspeed);
5361 __tmp.put_f32_le(self.pitchspeed);
5362 __tmp.put_f32_le(self.yawspeed);
5363 for val in &self.covariance {
5364 __tmp.put_f32_le(*val);
5365 }
5366 if matches!(version, MavlinkVersion::V2) {
5367 let len = __tmp.len();
5368 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5369 } else {
5370 __tmp.len()
5371 }
5372 }
5373}
5374#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5375#[doc = ""]
5376#[doc = "ID: 83"]
5377#[derive(Debug, Clone, PartialEq)]
5378#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5379#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5380pub struct ATTITUDE_TARGET_DATA {
5381 #[doc = "Timestamp (time since system boot)."]
5382 pub time_boot_ms: u32,
5383 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5384 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5385 pub q: [f32; 4],
5386 #[doc = "Body roll rate"]
5387 pub body_roll_rate: f32,
5388 #[doc = "Body pitch rate"]
5389 pub body_pitch_rate: f32,
5390 #[doc = "Body yaw rate"]
5391 pub body_yaw_rate: f32,
5392 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5393 pub thrust: f32,
5394 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5395 pub type_mask: AttitudeTargetTypemask,
5396}
5397impl ATTITUDE_TARGET_DATA {
5398 pub const ENCODED_LEN: usize = 37usize;
5399 pub const DEFAULT: Self = Self {
5400 time_boot_ms: 0_u32,
5401 q: [0.0_f32; 4usize],
5402 body_roll_rate: 0.0_f32,
5403 body_pitch_rate: 0.0_f32,
5404 body_yaw_rate: 0.0_f32,
5405 thrust: 0.0_f32,
5406 type_mask: AttitudeTargetTypemask::DEFAULT,
5407 };
5408 #[cfg(feature = "arbitrary")]
5409 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5410 use arbitrary::{Arbitrary, Unstructured};
5411 let mut buf = [0u8; 1024];
5412 rng.fill_bytes(&mut buf);
5413 let mut unstructured = Unstructured::new(&buf);
5414 Self::arbitrary(&mut unstructured).unwrap_or_default()
5415 }
5416}
5417impl Default for ATTITUDE_TARGET_DATA {
5418 fn default() -> Self {
5419 Self::DEFAULT.clone()
5420 }
5421}
5422impl MessageData for ATTITUDE_TARGET_DATA {
5423 type Message = MavMessage;
5424 const ID: u32 = 83u32;
5425 const NAME: &'static str = "ATTITUDE_TARGET";
5426 const EXTRA_CRC: u8 = 22u8;
5427 const ENCODED_LEN: usize = 37usize;
5428 fn deser(
5429 _version: MavlinkVersion,
5430 __input: &[u8],
5431 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5432 let avail_len = __input.len();
5433 let mut payload_buf = [0; Self::ENCODED_LEN];
5434 let mut buf = if avail_len < Self::ENCODED_LEN {
5435 payload_buf[0..avail_len].copy_from_slice(__input);
5436 Bytes::new(&payload_buf)
5437 } else {
5438 Bytes::new(__input)
5439 };
5440 let mut __struct = Self::default();
5441 __struct.time_boot_ms = buf.get_u32_le();
5442 for v in &mut __struct.q {
5443 let val = buf.get_f32_le();
5444 *v = val;
5445 }
5446 __struct.body_roll_rate = buf.get_f32_le();
5447 __struct.body_pitch_rate = buf.get_f32_le();
5448 __struct.body_yaw_rate = buf.get_f32_le();
5449 __struct.thrust = buf.get_f32_le();
5450 let tmp = buf.get_u8();
5451 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5452 tmp & AttitudeTargetTypemask::all().bits(),
5453 )
5454 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5455 flag_type: "AttitudeTargetTypemask",
5456 value: tmp as u32,
5457 })?;
5458 Ok(__struct)
5459 }
5460 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5461 let mut __tmp = BytesMut::new(bytes);
5462 #[allow(clippy::absurd_extreme_comparisons)]
5463 #[allow(unused_comparisons)]
5464 if __tmp.remaining() < Self::ENCODED_LEN {
5465 panic!(
5466 "buffer is too small (need {} bytes, but got {})",
5467 Self::ENCODED_LEN,
5468 __tmp.remaining(),
5469 )
5470 }
5471 __tmp.put_u32_le(self.time_boot_ms);
5472 for val in &self.q {
5473 __tmp.put_f32_le(*val);
5474 }
5475 __tmp.put_f32_le(self.body_roll_rate);
5476 __tmp.put_f32_le(self.body_pitch_rate);
5477 __tmp.put_f32_le(self.body_yaw_rate);
5478 __tmp.put_f32_le(self.thrust);
5479 __tmp.put_u8(self.type_mask.bits());
5480 if matches!(version, MavlinkVersion::V2) {
5481 let len = __tmp.len();
5482 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5483 } else {
5484 __tmp.len()
5485 }
5486 }
5487}
5488#[doc = "Motion capture attitude and position."]
5489#[doc = ""]
5490#[doc = "ID: 138"]
5491#[derive(Debug, Clone, PartialEq)]
5492#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5493#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5494pub struct ATT_POS_MOCAP_DATA {
5495 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5496 pub time_usec: u64,
5497 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5498 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5499 pub q: [f32; 4],
5500 #[doc = "X position (NED)"]
5501 pub x: f32,
5502 #[doc = "Y position (NED)"]
5503 pub y: f32,
5504 #[doc = "Z position (NED)"]
5505 pub z: f32,
5506 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5507 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5508 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5509 pub covariance: [f32; 21],
5510}
5511impl ATT_POS_MOCAP_DATA {
5512 pub const ENCODED_LEN: usize = 120usize;
5513 pub const DEFAULT: Self = Self {
5514 time_usec: 0_u64,
5515 q: [0.0_f32; 4usize],
5516 x: 0.0_f32,
5517 y: 0.0_f32,
5518 z: 0.0_f32,
5519 covariance: [0.0_f32; 21usize],
5520 };
5521 #[cfg(feature = "arbitrary")]
5522 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5523 use arbitrary::{Arbitrary, Unstructured};
5524 let mut buf = [0u8; 1024];
5525 rng.fill_bytes(&mut buf);
5526 let mut unstructured = Unstructured::new(&buf);
5527 Self::arbitrary(&mut unstructured).unwrap_or_default()
5528 }
5529}
5530impl Default for ATT_POS_MOCAP_DATA {
5531 fn default() -> Self {
5532 Self::DEFAULT.clone()
5533 }
5534}
5535impl MessageData for ATT_POS_MOCAP_DATA {
5536 type Message = MavMessage;
5537 const ID: u32 = 138u32;
5538 const NAME: &'static str = "ATT_POS_MOCAP";
5539 const EXTRA_CRC: u8 = 109u8;
5540 const ENCODED_LEN: usize = 120usize;
5541 fn deser(
5542 _version: MavlinkVersion,
5543 __input: &[u8],
5544 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5545 let avail_len = __input.len();
5546 let mut payload_buf = [0; Self::ENCODED_LEN];
5547 let mut buf = if avail_len < Self::ENCODED_LEN {
5548 payload_buf[0..avail_len].copy_from_slice(__input);
5549 Bytes::new(&payload_buf)
5550 } else {
5551 Bytes::new(__input)
5552 };
5553 let mut __struct = Self::default();
5554 __struct.time_usec = buf.get_u64_le();
5555 for v in &mut __struct.q {
5556 let val = buf.get_f32_le();
5557 *v = val;
5558 }
5559 __struct.x = buf.get_f32_le();
5560 __struct.y = buf.get_f32_le();
5561 __struct.z = buf.get_f32_le();
5562 for v in &mut __struct.covariance {
5563 let val = buf.get_f32_le();
5564 *v = val;
5565 }
5566 Ok(__struct)
5567 }
5568 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5569 let mut __tmp = BytesMut::new(bytes);
5570 #[allow(clippy::absurd_extreme_comparisons)]
5571 #[allow(unused_comparisons)]
5572 if __tmp.remaining() < Self::ENCODED_LEN {
5573 panic!(
5574 "buffer is too small (need {} bytes, but got {})",
5575 Self::ENCODED_LEN,
5576 __tmp.remaining(),
5577 )
5578 }
5579 __tmp.put_u64_le(self.time_usec);
5580 for val in &self.q {
5581 __tmp.put_f32_le(*val);
5582 }
5583 __tmp.put_f32_le(self.x);
5584 __tmp.put_f32_le(self.y);
5585 __tmp.put_f32_le(self.z);
5586 if matches!(version, MavlinkVersion::V2) {
5587 for val in &self.covariance {
5588 __tmp.put_f32_le(*val);
5589 }
5590 let len = __tmp.len();
5591 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5592 } else {
5593 __tmp.len()
5594 }
5595 }
5596}
5597#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5598#[doc = ""]
5599#[doc = "ID: 7"]
5600#[derive(Debug, Clone, PartialEq)]
5601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5602#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5603pub struct AUTH_KEY_DATA {
5604 #[doc = "key"]
5605 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5606 pub key: [u8; 32],
5607}
5608impl AUTH_KEY_DATA {
5609 pub const ENCODED_LEN: usize = 32usize;
5610 pub const DEFAULT: Self = Self {
5611 key: [0_u8; 32usize],
5612 };
5613 #[cfg(feature = "arbitrary")]
5614 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5615 use arbitrary::{Arbitrary, Unstructured};
5616 let mut buf = [0u8; 1024];
5617 rng.fill_bytes(&mut buf);
5618 let mut unstructured = Unstructured::new(&buf);
5619 Self::arbitrary(&mut unstructured).unwrap_or_default()
5620 }
5621}
5622impl Default for AUTH_KEY_DATA {
5623 fn default() -> Self {
5624 Self::DEFAULT.clone()
5625 }
5626}
5627impl MessageData for AUTH_KEY_DATA {
5628 type Message = MavMessage;
5629 const ID: u32 = 7u32;
5630 const NAME: &'static str = "AUTH_KEY";
5631 const EXTRA_CRC: u8 = 119u8;
5632 const ENCODED_LEN: usize = 32usize;
5633 fn deser(
5634 _version: MavlinkVersion,
5635 __input: &[u8],
5636 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5637 let avail_len = __input.len();
5638 let mut payload_buf = [0; Self::ENCODED_LEN];
5639 let mut buf = if avail_len < Self::ENCODED_LEN {
5640 payload_buf[0..avail_len].copy_from_slice(__input);
5641 Bytes::new(&payload_buf)
5642 } else {
5643 Bytes::new(__input)
5644 };
5645 let mut __struct = Self::default();
5646 for v in &mut __struct.key {
5647 let val = buf.get_u8();
5648 *v = val;
5649 }
5650 Ok(__struct)
5651 }
5652 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5653 let mut __tmp = BytesMut::new(bytes);
5654 #[allow(clippy::absurd_extreme_comparisons)]
5655 #[allow(unused_comparisons)]
5656 if __tmp.remaining() < Self::ENCODED_LEN {
5657 panic!(
5658 "buffer is too small (need {} bytes, but got {})",
5659 Self::ENCODED_LEN,
5660 __tmp.remaining(),
5661 )
5662 }
5663 for val in &self.key {
5664 __tmp.put_u8(*val);
5665 }
5666 if matches!(version, MavlinkVersion::V2) {
5667 let len = __tmp.len();
5668 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5669 } else {
5670 __tmp.len()
5671 }
5672 }
5673}
5674#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
5675#[doc = ""]
5676#[doc = "ID: 286"]
5677#[derive(Debug, Clone, PartialEq)]
5678#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5679#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5680pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5681 #[doc = "Timestamp (time since system boot)."]
5682 pub time_boot_us: u64,
5683 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
5684 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5685 pub q: [f32; 4],
5686 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
5687 pub q_estimated_delay_us: u32,
5688 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
5689 pub vx: f32,
5690 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
5691 pub vy: f32,
5692 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
5693 pub vz: f32,
5694 #[doc = "Estimated delay of the speed data. 0 if unknown."]
5695 pub v_estimated_delay_us: u32,
5696 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
5697 pub feed_forward_angular_velocity_z: f32,
5698 #[doc = "Bitmap indicating which estimator outputs are valid."]
5699 pub estimator_status: EstimatorStatusFlags,
5700 #[doc = "System ID"]
5701 pub target_system: u8,
5702 #[doc = "Component ID"]
5703 pub target_component: u8,
5704 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
5705 pub landed_state: MavLandedState,
5706 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
5707 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5708 pub angular_velocity_z: f32,
5709}
5710impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5711 pub const ENCODED_LEN: usize = 57usize;
5712 pub const DEFAULT: Self = Self {
5713 time_boot_us: 0_u64,
5714 q: [0.0_f32; 4usize],
5715 q_estimated_delay_us: 0_u32,
5716 vx: 0.0_f32,
5717 vy: 0.0_f32,
5718 vz: 0.0_f32,
5719 v_estimated_delay_us: 0_u32,
5720 feed_forward_angular_velocity_z: 0.0_f32,
5721 estimator_status: EstimatorStatusFlags::DEFAULT,
5722 target_system: 0_u8,
5723 target_component: 0_u8,
5724 landed_state: MavLandedState::DEFAULT,
5725 angular_velocity_z: 0.0_f32,
5726 };
5727 #[cfg(feature = "arbitrary")]
5728 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5729 use arbitrary::{Arbitrary, Unstructured};
5730 let mut buf = [0u8; 1024];
5731 rng.fill_bytes(&mut buf);
5732 let mut unstructured = Unstructured::new(&buf);
5733 Self::arbitrary(&mut unstructured).unwrap_or_default()
5734 }
5735}
5736impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5737 fn default() -> Self {
5738 Self::DEFAULT.clone()
5739 }
5740}
5741impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5742 type Message = MavMessage;
5743 const ID: u32 = 286u32;
5744 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
5745 const EXTRA_CRC: u8 = 210u8;
5746 const ENCODED_LEN: usize = 57usize;
5747 fn deser(
5748 _version: MavlinkVersion,
5749 __input: &[u8],
5750 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5751 let avail_len = __input.len();
5752 let mut payload_buf = [0; Self::ENCODED_LEN];
5753 let mut buf = if avail_len < Self::ENCODED_LEN {
5754 payload_buf[0..avail_len].copy_from_slice(__input);
5755 Bytes::new(&payload_buf)
5756 } else {
5757 Bytes::new(__input)
5758 };
5759 let mut __struct = Self::default();
5760 __struct.time_boot_us = buf.get_u64_le();
5761 for v in &mut __struct.q {
5762 let val = buf.get_f32_le();
5763 *v = val;
5764 }
5765 __struct.q_estimated_delay_us = buf.get_u32_le();
5766 __struct.vx = buf.get_f32_le();
5767 __struct.vy = buf.get_f32_le();
5768 __struct.vz = buf.get_f32_le();
5769 __struct.v_estimated_delay_us = buf.get_u32_le();
5770 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
5771 let tmp = buf.get_u16_le();
5772 __struct.estimator_status = EstimatorStatusFlags::from_bits(
5773 tmp & EstimatorStatusFlags::all().bits(),
5774 )
5775 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5776 flag_type: "EstimatorStatusFlags",
5777 value: tmp as u32,
5778 })?;
5779 __struct.target_system = buf.get_u8();
5780 __struct.target_component = buf.get_u8();
5781 let tmp = buf.get_u8();
5782 __struct.landed_state =
5783 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5784 enum_type: "MavLandedState",
5785 value: tmp as u32,
5786 })?;
5787 __struct.angular_velocity_z = buf.get_f32_le();
5788 Ok(__struct)
5789 }
5790 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5791 let mut __tmp = BytesMut::new(bytes);
5792 #[allow(clippy::absurd_extreme_comparisons)]
5793 #[allow(unused_comparisons)]
5794 if __tmp.remaining() < Self::ENCODED_LEN {
5795 panic!(
5796 "buffer is too small (need {} bytes, but got {})",
5797 Self::ENCODED_LEN,
5798 __tmp.remaining(),
5799 )
5800 }
5801 __tmp.put_u64_le(self.time_boot_us);
5802 for val in &self.q {
5803 __tmp.put_f32_le(*val);
5804 }
5805 __tmp.put_u32_le(self.q_estimated_delay_us);
5806 __tmp.put_f32_le(self.vx);
5807 __tmp.put_f32_le(self.vy);
5808 __tmp.put_f32_le(self.vz);
5809 __tmp.put_u32_le(self.v_estimated_delay_us);
5810 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
5811 __tmp.put_u16_le(self.estimator_status.bits());
5812 __tmp.put_u8(self.target_system);
5813 __tmp.put_u8(self.target_component);
5814 __tmp.put_u8(self.landed_state as u8);
5815 if matches!(version, MavlinkVersion::V2) {
5816 __tmp.put_f32_le(self.angular_velocity_z);
5817 let len = __tmp.len();
5818 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5819 } else {
5820 __tmp.len()
5821 }
5822 }
5823}
5824#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
5825#[doc = ""]
5826#[doc = "ID: 148"]
5827#[derive(Debug, Clone, PartialEq)]
5828#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5829#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5830pub struct AUTOPILOT_VERSION_DATA {
5831 #[doc = "Bitmap of capabilities"]
5832 pub capabilities: MavProtocolCapability,
5833 #[doc = "UID if provided by hardware (see uid2)"]
5834 pub uid: u64,
5835 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
5836 pub flight_sw_version: u32,
5837 #[doc = "Middleware version number"]
5838 pub middleware_sw_version: u32,
5839 #[doc = "Operating system version number"]
5840 pub os_sw_version: u32,
5841 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
5842 pub board_version: u32,
5843 #[doc = "ID of the board vendor"]
5844 pub vendor_id: u16,
5845 #[doc = "ID of the product"]
5846 pub product_id: u16,
5847 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5848 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5849 pub flight_custom_version: [u8; 8],
5850 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5851 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5852 pub middleware_custom_version: [u8; 8],
5853 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5854 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5855 pub os_custom_version: [u8; 8],
5856 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
5857 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5858 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5859 pub uid2: [u8; 18],
5860}
5861impl AUTOPILOT_VERSION_DATA {
5862 pub const ENCODED_LEN: usize = 78usize;
5863 pub const DEFAULT: Self = Self {
5864 capabilities: MavProtocolCapability::DEFAULT,
5865 uid: 0_u64,
5866 flight_sw_version: 0_u32,
5867 middleware_sw_version: 0_u32,
5868 os_sw_version: 0_u32,
5869 board_version: 0_u32,
5870 vendor_id: 0_u16,
5871 product_id: 0_u16,
5872 flight_custom_version: [0_u8; 8usize],
5873 middleware_custom_version: [0_u8; 8usize],
5874 os_custom_version: [0_u8; 8usize],
5875 uid2: [0_u8; 18usize],
5876 };
5877 #[cfg(feature = "arbitrary")]
5878 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5879 use arbitrary::{Arbitrary, Unstructured};
5880 let mut buf = [0u8; 1024];
5881 rng.fill_bytes(&mut buf);
5882 let mut unstructured = Unstructured::new(&buf);
5883 Self::arbitrary(&mut unstructured).unwrap_or_default()
5884 }
5885}
5886impl Default for AUTOPILOT_VERSION_DATA {
5887 fn default() -> Self {
5888 Self::DEFAULT.clone()
5889 }
5890}
5891impl MessageData for AUTOPILOT_VERSION_DATA {
5892 type Message = MavMessage;
5893 const ID: u32 = 148u32;
5894 const NAME: &'static str = "AUTOPILOT_VERSION";
5895 const EXTRA_CRC: u8 = 178u8;
5896 const ENCODED_LEN: usize = 78usize;
5897 fn deser(
5898 _version: MavlinkVersion,
5899 __input: &[u8],
5900 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5901 let avail_len = __input.len();
5902 let mut payload_buf = [0; Self::ENCODED_LEN];
5903 let mut buf = if avail_len < Self::ENCODED_LEN {
5904 payload_buf[0..avail_len].copy_from_slice(__input);
5905 Bytes::new(&payload_buf)
5906 } else {
5907 Bytes::new(__input)
5908 };
5909 let mut __struct = Self::default();
5910 let tmp = buf.get_u64_le();
5911 __struct.capabilities = MavProtocolCapability::from_bits(
5912 tmp & MavProtocolCapability::all().bits(),
5913 )
5914 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5915 flag_type: "MavProtocolCapability",
5916 value: tmp as u32,
5917 })?;
5918 __struct.uid = buf.get_u64_le();
5919 __struct.flight_sw_version = buf.get_u32_le();
5920 __struct.middleware_sw_version = buf.get_u32_le();
5921 __struct.os_sw_version = buf.get_u32_le();
5922 __struct.board_version = buf.get_u32_le();
5923 __struct.vendor_id = buf.get_u16_le();
5924 __struct.product_id = buf.get_u16_le();
5925 for v in &mut __struct.flight_custom_version {
5926 let val = buf.get_u8();
5927 *v = val;
5928 }
5929 for v in &mut __struct.middleware_custom_version {
5930 let val = buf.get_u8();
5931 *v = val;
5932 }
5933 for v in &mut __struct.os_custom_version {
5934 let val = buf.get_u8();
5935 *v = val;
5936 }
5937 for v in &mut __struct.uid2 {
5938 let val = buf.get_u8();
5939 *v = val;
5940 }
5941 Ok(__struct)
5942 }
5943 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5944 let mut __tmp = BytesMut::new(bytes);
5945 #[allow(clippy::absurd_extreme_comparisons)]
5946 #[allow(unused_comparisons)]
5947 if __tmp.remaining() < Self::ENCODED_LEN {
5948 panic!(
5949 "buffer is too small (need {} bytes, but got {})",
5950 Self::ENCODED_LEN,
5951 __tmp.remaining(),
5952 )
5953 }
5954 __tmp.put_u64_le(self.capabilities.bits());
5955 __tmp.put_u64_le(self.uid);
5956 __tmp.put_u32_le(self.flight_sw_version);
5957 __tmp.put_u32_le(self.middleware_sw_version);
5958 __tmp.put_u32_le(self.os_sw_version);
5959 __tmp.put_u32_le(self.board_version);
5960 __tmp.put_u16_le(self.vendor_id);
5961 __tmp.put_u16_le(self.product_id);
5962 for val in &self.flight_custom_version {
5963 __tmp.put_u8(*val);
5964 }
5965 for val in &self.middleware_custom_version {
5966 __tmp.put_u8(*val);
5967 }
5968 for val in &self.os_custom_version {
5969 __tmp.put_u8(*val);
5970 }
5971 if matches!(version, MavlinkVersion::V2) {
5972 for val in &self.uid2 {
5973 __tmp.put_u8(*val);
5974 }
5975 let len = __tmp.len();
5976 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5977 } else {
5978 __tmp.len()
5979 }
5980 }
5981}
5982#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
5983#[doc = ""]
5984#[doc = "ID: 435"]
5985#[derive(Debug, Clone, PartialEq)]
5986#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5987#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5988pub struct AVAILABLE_MODES_DATA {
5989 #[doc = "A bitfield for use for autopilot-specific flags"]
5990 pub custom_mode: u32,
5991 #[doc = "Mode properties."]
5992 pub properties: MavModeProperty,
5993 #[doc = "The total number of available modes for the current vehicle type."]
5994 pub number_modes: u8,
5995 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
5996 pub mode_index: u8,
5997 #[doc = "Standard mode."]
5998 pub standard_mode: MavStandardMode,
5999 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6000 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6001 pub mode_name: [u8; 35],
6002}
6003impl AVAILABLE_MODES_DATA {
6004 pub const ENCODED_LEN: usize = 46usize;
6005 pub const DEFAULT: Self = Self {
6006 custom_mode: 0_u32,
6007 properties: MavModeProperty::DEFAULT,
6008 number_modes: 0_u8,
6009 mode_index: 0_u8,
6010 standard_mode: MavStandardMode::DEFAULT,
6011 mode_name: [0_u8; 35usize],
6012 };
6013 #[cfg(feature = "arbitrary")]
6014 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6015 use arbitrary::{Arbitrary, Unstructured};
6016 let mut buf = [0u8; 1024];
6017 rng.fill_bytes(&mut buf);
6018 let mut unstructured = Unstructured::new(&buf);
6019 Self::arbitrary(&mut unstructured).unwrap_or_default()
6020 }
6021}
6022impl Default for AVAILABLE_MODES_DATA {
6023 fn default() -> Self {
6024 Self::DEFAULT.clone()
6025 }
6026}
6027impl MessageData for AVAILABLE_MODES_DATA {
6028 type Message = MavMessage;
6029 const ID: u32 = 435u32;
6030 const NAME: &'static str = "AVAILABLE_MODES";
6031 const EXTRA_CRC: u8 = 134u8;
6032 const ENCODED_LEN: usize = 46usize;
6033 fn deser(
6034 _version: MavlinkVersion,
6035 __input: &[u8],
6036 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6037 let avail_len = __input.len();
6038 let mut payload_buf = [0; Self::ENCODED_LEN];
6039 let mut buf = if avail_len < Self::ENCODED_LEN {
6040 payload_buf[0..avail_len].copy_from_slice(__input);
6041 Bytes::new(&payload_buf)
6042 } else {
6043 Bytes::new(__input)
6044 };
6045 let mut __struct = Self::default();
6046 __struct.custom_mode = buf.get_u32_le();
6047 let tmp = buf.get_u32_le();
6048 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6049 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6050 flag_type: "MavModeProperty",
6051 value: tmp as u32,
6052 })?;
6053 __struct.number_modes = buf.get_u8();
6054 __struct.mode_index = buf.get_u8();
6055 let tmp = buf.get_u8();
6056 __struct.standard_mode =
6057 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6058 enum_type: "MavStandardMode",
6059 value: tmp as u32,
6060 })?;
6061 for v in &mut __struct.mode_name {
6062 let val = buf.get_u8();
6063 *v = val;
6064 }
6065 Ok(__struct)
6066 }
6067 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6068 let mut __tmp = BytesMut::new(bytes);
6069 #[allow(clippy::absurd_extreme_comparisons)]
6070 #[allow(unused_comparisons)]
6071 if __tmp.remaining() < Self::ENCODED_LEN {
6072 panic!(
6073 "buffer is too small (need {} bytes, but got {})",
6074 Self::ENCODED_LEN,
6075 __tmp.remaining(),
6076 )
6077 }
6078 __tmp.put_u32_le(self.custom_mode);
6079 __tmp.put_u32_le(self.properties.bits());
6080 __tmp.put_u8(self.number_modes);
6081 __tmp.put_u8(self.mode_index);
6082 __tmp.put_u8(self.standard_mode as u8);
6083 for val in &self.mode_name {
6084 __tmp.put_u8(*val);
6085 }
6086 if matches!(version, MavlinkVersion::V2) {
6087 let len = __tmp.len();
6088 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6089 } else {
6090 __tmp.len()
6091 }
6092 }
6093}
6094#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6095#[doc = ""]
6096#[doc = "ID: 437"]
6097#[derive(Debug, Clone, PartialEq)]
6098#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6099#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6100pub struct AVAILABLE_MODES_MONITOR_DATA {
6101 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6102 pub seq: u8,
6103}
6104impl AVAILABLE_MODES_MONITOR_DATA {
6105 pub const ENCODED_LEN: usize = 1usize;
6106 pub const DEFAULT: Self = Self { seq: 0_u8 };
6107 #[cfg(feature = "arbitrary")]
6108 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6109 use arbitrary::{Arbitrary, Unstructured};
6110 let mut buf = [0u8; 1024];
6111 rng.fill_bytes(&mut buf);
6112 let mut unstructured = Unstructured::new(&buf);
6113 Self::arbitrary(&mut unstructured).unwrap_or_default()
6114 }
6115}
6116impl Default for AVAILABLE_MODES_MONITOR_DATA {
6117 fn default() -> Self {
6118 Self::DEFAULT.clone()
6119 }
6120}
6121impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6122 type Message = MavMessage;
6123 const ID: u32 = 437u32;
6124 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6125 const EXTRA_CRC: u8 = 30u8;
6126 const ENCODED_LEN: usize = 1usize;
6127 fn deser(
6128 _version: MavlinkVersion,
6129 __input: &[u8],
6130 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6131 let avail_len = __input.len();
6132 let mut payload_buf = [0; Self::ENCODED_LEN];
6133 let mut buf = if avail_len < Self::ENCODED_LEN {
6134 payload_buf[0..avail_len].copy_from_slice(__input);
6135 Bytes::new(&payload_buf)
6136 } else {
6137 Bytes::new(__input)
6138 };
6139 let mut __struct = Self::default();
6140 __struct.seq = buf.get_u8();
6141 Ok(__struct)
6142 }
6143 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6144 let mut __tmp = BytesMut::new(bytes);
6145 #[allow(clippy::absurd_extreme_comparisons)]
6146 #[allow(unused_comparisons)]
6147 if __tmp.remaining() < Self::ENCODED_LEN {
6148 panic!(
6149 "buffer is too small (need {} bytes, but got {})",
6150 Self::ENCODED_LEN,
6151 __tmp.remaining(),
6152 )
6153 }
6154 __tmp.put_u8(self.seq);
6155 if matches!(version, MavlinkVersion::V2) {
6156 let len = __tmp.len();
6157 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6158 } else {
6159 __tmp.len()
6160 }
6161 }
6162}
6163#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6164#[doc = ""]
6165#[doc = "ID: 372"]
6166#[derive(Debug, Clone, PartialEq)]
6167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6169pub struct BATTERY_INFO_DATA {
6170 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6171 pub discharge_minimum_voltage: f32,
6172 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6173 pub charging_minimum_voltage: f32,
6174 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6175 pub resting_minimum_voltage: f32,
6176 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6177 pub charging_maximum_voltage: f32,
6178 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6179 pub charging_maximum_current: f32,
6180 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6181 pub nominal_voltage: f32,
6182 #[doc = "Maximum pack discharge current. 0: field not provided."]
6183 pub discharge_maximum_current: f32,
6184 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6185 pub discharge_maximum_burst_current: f32,
6186 #[doc = "Fully charged design capacity. 0: field not provided."]
6187 pub design_capacity: f32,
6188 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6189 pub full_charge_capacity: f32,
6190 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6191 pub cycle_count: u16,
6192 #[doc = "Battery weight. 0: field not provided."]
6193 pub weight: u16,
6194 #[doc = "Battery ID"]
6195 pub id: u8,
6196 #[doc = "Function of the battery."]
6197 pub battery_function: MavBatteryFunction,
6198 #[doc = "Type (chemistry) of the battery."]
6199 pub mavtype: MavBatteryType,
6200 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6201 pub state_of_health: u8,
6202 #[doc = "Number of battery cells in series. 0: field not provided."]
6203 pub cells_in_series: u8,
6204 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6205 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6206 pub manufacture_date: [u8; 9],
6207 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6208 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6209 pub serial_number: [u8; 32],
6210 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6211 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6212 pub name: [u8; 50],
6213}
6214impl BATTERY_INFO_DATA {
6215 pub const ENCODED_LEN: usize = 140usize;
6216 pub const DEFAULT: Self = Self {
6217 discharge_minimum_voltage: 0.0_f32,
6218 charging_minimum_voltage: 0.0_f32,
6219 resting_minimum_voltage: 0.0_f32,
6220 charging_maximum_voltage: 0.0_f32,
6221 charging_maximum_current: 0.0_f32,
6222 nominal_voltage: 0.0_f32,
6223 discharge_maximum_current: 0.0_f32,
6224 discharge_maximum_burst_current: 0.0_f32,
6225 design_capacity: 0.0_f32,
6226 full_charge_capacity: 0.0_f32,
6227 cycle_count: 0_u16,
6228 weight: 0_u16,
6229 id: 0_u8,
6230 battery_function: MavBatteryFunction::DEFAULT,
6231 mavtype: MavBatteryType::DEFAULT,
6232 state_of_health: 0_u8,
6233 cells_in_series: 0_u8,
6234 manufacture_date: [0_u8; 9usize],
6235 serial_number: [0_u8; 32usize],
6236 name: [0_u8; 50usize],
6237 };
6238 #[cfg(feature = "arbitrary")]
6239 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6240 use arbitrary::{Arbitrary, Unstructured};
6241 let mut buf = [0u8; 1024];
6242 rng.fill_bytes(&mut buf);
6243 let mut unstructured = Unstructured::new(&buf);
6244 Self::arbitrary(&mut unstructured).unwrap_or_default()
6245 }
6246}
6247impl Default for BATTERY_INFO_DATA {
6248 fn default() -> Self {
6249 Self::DEFAULT.clone()
6250 }
6251}
6252impl MessageData for BATTERY_INFO_DATA {
6253 type Message = MavMessage;
6254 const ID: u32 = 372u32;
6255 const NAME: &'static str = "BATTERY_INFO";
6256 const EXTRA_CRC: u8 = 26u8;
6257 const ENCODED_LEN: usize = 140usize;
6258 fn deser(
6259 _version: MavlinkVersion,
6260 __input: &[u8],
6261 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6262 let avail_len = __input.len();
6263 let mut payload_buf = [0; Self::ENCODED_LEN];
6264 let mut buf = if avail_len < Self::ENCODED_LEN {
6265 payload_buf[0..avail_len].copy_from_slice(__input);
6266 Bytes::new(&payload_buf)
6267 } else {
6268 Bytes::new(__input)
6269 };
6270 let mut __struct = Self::default();
6271 __struct.discharge_minimum_voltage = buf.get_f32_le();
6272 __struct.charging_minimum_voltage = buf.get_f32_le();
6273 __struct.resting_minimum_voltage = buf.get_f32_le();
6274 __struct.charging_maximum_voltage = buf.get_f32_le();
6275 __struct.charging_maximum_current = buf.get_f32_le();
6276 __struct.nominal_voltage = buf.get_f32_le();
6277 __struct.discharge_maximum_current = buf.get_f32_le();
6278 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6279 __struct.design_capacity = buf.get_f32_le();
6280 __struct.full_charge_capacity = buf.get_f32_le();
6281 __struct.cycle_count = buf.get_u16_le();
6282 __struct.weight = buf.get_u16_le();
6283 __struct.id = buf.get_u8();
6284 let tmp = buf.get_u8();
6285 __struct.battery_function =
6286 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6287 enum_type: "MavBatteryFunction",
6288 value: tmp as u32,
6289 })?;
6290 let tmp = buf.get_u8();
6291 __struct.mavtype =
6292 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6293 enum_type: "MavBatteryType",
6294 value: tmp as u32,
6295 })?;
6296 __struct.state_of_health = buf.get_u8();
6297 __struct.cells_in_series = buf.get_u8();
6298 for v in &mut __struct.manufacture_date {
6299 let val = buf.get_u8();
6300 *v = val;
6301 }
6302 for v in &mut __struct.serial_number {
6303 let val = buf.get_u8();
6304 *v = val;
6305 }
6306 for v in &mut __struct.name {
6307 let val = buf.get_u8();
6308 *v = val;
6309 }
6310 Ok(__struct)
6311 }
6312 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6313 let mut __tmp = BytesMut::new(bytes);
6314 #[allow(clippy::absurd_extreme_comparisons)]
6315 #[allow(unused_comparisons)]
6316 if __tmp.remaining() < Self::ENCODED_LEN {
6317 panic!(
6318 "buffer is too small (need {} bytes, but got {})",
6319 Self::ENCODED_LEN,
6320 __tmp.remaining(),
6321 )
6322 }
6323 __tmp.put_f32_le(self.discharge_minimum_voltage);
6324 __tmp.put_f32_le(self.charging_minimum_voltage);
6325 __tmp.put_f32_le(self.resting_minimum_voltage);
6326 __tmp.put_f32_le(self.charging_maximum_voltage);
6327 __tmp.put_f32_le(self.charging_maximum_current);
6328 __tmp.put_f32_le(self.nominal_voltage);
6329 __tmp.put_f32_le(self.discharge_maximum_current);
6330 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6331 __tmp.put_f32_le(self.design_capacity);
6332 __tmp.put_f32_le(self.full_charge_capacity);
6333 __tmp.put_u16_le(self.cycle_count);
6334 __tmp.put_u16_le(self.weight);
6335 __tmp.put_u8(self.id);
6336 __tmp.put_u8(self.battery_function as u8);
6337 __tmp.put_u8(self.mavtype as u8);
6338 __tmp.put_u8(self.state_of_health);
6339 __tmp.put_u8(self.cells_in_series);
6340 for val in &self.manufacture_date {
6341 __tmp.put_u8(*val);
6342 }
6343 for val in &self.serial_number {
6344 __tmp.put_u8(*val);
6345 }
6346 for val in &self.name {
6347 __tmp.put_u8(*val);
6348 }
6349 if matches!(version, MavlinkVersion::V2) {
6350 let len = __tmp.len();
6351 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6352 } else {
6353 __tmp.len()
6354 }
6355 }
6356}
6357#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6358#[doc = ""]
6359#[doc = "ID: 147"]
6360#[derive(Debug, Clone, PartialEq)]
6361#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6362#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6363pub struct BATTERY_STATUS_DATA {
6364 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6365 pub current_consumed: i32,
6366 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6367 pub energy_consumed: i32,
6368 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6369 pub temperature: i16,
6370 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6371 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6372 pub voltages: [u16; 10],
6373 #[doc = "Battery current, -1: autopilot does not measure the current"]
6374 pub current_battery: i16,
6375 #[doc = "Battery ID"]
6376 pub id: u8,
6377 #[doc = "Function of the battery"]
6378 pub battery_function: MavBatteryFunction,
6379 #[doc = "Type (chemistry) of the battery"]
6380 pub mavtype: MavBatteryType,
6381 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6382 pub battery_remaining: i8,
6383 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6384 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6385 pub time_remaining: i32,
6386 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6387 #[cfg_attr(feature = "serde", serde(default))]
6388 pub charge_state: MavBatteryChargeState,
6389 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6390 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6391 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6392 pub voltages_ext: [u16; 4],
6393 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6394 #[cfg_attr(feature = "serde", serde(default))]
6395 pub mode: MavBatteryMode,
6396 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6397 #[cfg_attr(feature = "serde", serde(default))]
6398 pub fault_bitmask: MavBatteryFault,
6399}
6400impl BATTERY_STATUS_DATA {
6401 pub const ENCODED_LEN: usize = 54usize;
6402 pub const DEFAULT: Self = Self {
6403 current_consumed: 0_i32,
6404 energy_consumed: 0_i32,
6405 temperature: 0_i16,
6406 voltages: [0_u16; 10usize],
6407 current_battery: 0_i16,
6408 id: 0_u8,
6409 battery_function: MavBatteryFunction::DEFAULT,
6410 mavtype: MavBatteryType::DEFAULT,
6411 battery_remaining: 0_i8,
6412 time_remaining: 0_i32,
6413 charge_state: MavBatteryChargeState::DEFAULT,
6414 voltages_ext: [0_u16; 4usize],
6415 mode: MavBatteryMode::DEFAULT,
6416 fault_bitmask: MavBatteryFault::DEFAULT,
6417 };
6418 #[cfg(feature = "arbitrary")]
6419 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6420 use arbitrary::{Arbitrary, Unstructured};
6421 let mut buf = [0u8; 1024];
6422 rng.fill_bytes(&mut buf);
6423 let mut unstructured = Unstructured::new(&buf);
6424 Self::arbitrary(&mut unstructured).unwrap_or_default()
6425 }
6426}
6427impl Default for BATTERY_STATUS_DATA {
6428 fn default() -> Self {
6429 Self::DEFAULT.clone()
6430 }
6431}
6432impl MessageData for BATTERY_STATUS_DATA {
6433 type Message = MavMessage;
6434 const ID: u32 = 147u32;
6435 const NAME: &'static str = "BATTERY_STATUS";
6436 const EXTRA_CRC: u8 = 154u8;
6437 const ENCODED_LEN: usize = 54usize;
6438 fn deser(
6439 _version: MavlinkVersion,
6440 __input: &[u8],
6441 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6442 let avail_len = __input.len();
6443 let mut payload_buf = [0; Self::ENCODED_LEN];
6444 let mut buf = if avail_len < Self::ENCODED_LEN {
6445 payload_buf[0..avail_len].copy_from_slice(__input);
6446 Bytes::new(&payload_buf)
6447 } else {
6448 Bytes::new(__input)
6449 };
6450 let mut __struct = Self::default();
6451 __struct.current_consumed = buf.get_i32_le();
6452 __struct.energy_consumed = buf.get_i32_le();
6453 __struct.temperature = buf.get_i16_le();
6454 for v in &mut __struct.voltages {
6455 let val = buf.get_u16_le();
6456 *v = val;
6457 }
6458 __struct.current_battery = buf.get_i16_le();
6459 __struct.id = buf.get_u8();
6460 let tmp = buf.get_u8();
6461 __struct.battery_function =
6462 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6463 enum_type: "MavBatteryFunction",
6464 value: tmp as u32,
6465 })?;
6466 let tmp = buf.get_u8();
6467 __struct.mavtype =
6468 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6469 enum_type: "MavBatteryType",
6470 value: tmp as u32,
6471 })?;
6472 __struct.battery_remaining = buf.get_i8();
6473 __struct.time_remaining = buf.get_i32_le();
6474 let tmp = buf.get_u8();
6475 __struct.charge_state =
6476 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6477 enum_type: "MavBatteryChargeState",
6478 value: tmp as u32,
6479 })?;
6480 for v in &mut __struct.voltages_ext {
6481 let val = buf.get_u16_le();
6482 *v = val;
6483 }
6484 let tmp = buf.get_u8();
6485 __struct.mode =
6486 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6487 enum_type: "MavBatteryMode",
6488 value: tmp as u32,
6489 })?;
6490 let tmp = buf.get_u32_le();
6491 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
6492 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6493 flag_type: "MavBatteryFault",
6494 value: tmp as u32,
6495 })?;
6496 Ok(__struct)
6497 }
6498 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6499 let mut __tmp = BytesMut::new(bytes);
6500 #[allow(clippy::absurd_extreme_comparisons)]
6501 #[allow(unused_comparisons)]
6502 if __tmp.remaining() < Self::ENCODED_LEN {
6503 panic!(
6504 "buffer is too small (need {} bytes, but got {})",
6505 Self::ENCODED_LEN,
6506 __tmp.remaining(),
6507 )
6508 }
6509 __tmp.put_i32_le(self.current_consumed);
6510 __tmp.put_i32_le(self.energy_consumed);
6511 __tmp.put_i16_le(self.temperature);
6512 for val in &self.voltages {
6513 __tmp.put_u16_le(*val);
6514 }
6515 __tmp.put_i16_le(self.current_battery);
6516 __tmp.put_u8(self.id);
6517 __tmp.put_u8(self.battery_function as u8);
6518 __tmp.put_u8(self.mavtype as u8);
6519 __tmp.put_i8(self.battery_remaining);
6520 if matches!(version, MavlinkVersion::V2) {
6521 __tmp.put_i32_le(self.time_remaining);
6522 __tmp.put_u8(self.charge_state as u8);
6523 for val in &self.voltages_ext {
6524 __tmp.put_u16_le(*val);
6525 }
6526 __tmp.put_u8(self.mode as u8);
6527 __tmp.put_u32_le(self.fault_bitmask.bits());
6528 let len = __tmp.len();
6529 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6530 } else {
6531 __tmp.len()
6532 }
6533 }
6534}
6535#[doc = "Report button state change."]
6536#[doc = ""]
6537#[doc = "ID: 257"]
6538#[derive(Debug, Clone, PartialEq)]
6539#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6540#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6541pub struct BUTTON_CHANGE_DATA {
6542 #[doc = "Timestamp (time since system boot)."]
6543 pub time_boot_ms: u32,
6544 #[doc = "Time of last change of button state."]
6545 pub last_change_ms: u32,
6546 #[doc = "Bitmap for state of buttons."]
6547 pub state: u8,
6548}
6549impl BUTTON_CHANGE_DATA {
6550 pub const ENCODED_LEN: usize = 9usize;
6551 pub const DEFAULT: Self = Self {
6552 time_boot_ms: 0_u32,
6553 last_change_ms: 0_u32,
6554 state: 0_u8,
6555 };
6556 #[cfg(feature = "arbitrary")]
6557 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6558 use arbitrary::{Arbitrary, Unstructured};
6559 let mut buf = [0u8; 1024];
6560 rng.fill_bytes(&mut buf);
6561 let mut unstructured = Unstructured::new(&buf);
6562 Self::arbitrary(&mut unstructured).unwrap_or_default()
6563 }
6564}
6565impl Default for BUTTON_CHANGE_DATA {
6566 fn default() -> Self {
6567 Self::DEFAULT.clone()
6568 }
6569}
6570impl MessageData for BUTTON_CHANGE_DATA {
6571 type Message = MavMessage;
6572 const ID: u32 = 257u32;
6573 const NAME: &'static str = "BUTTON_CHANGE";
6574 const EXTRA_CRC: u8 = 131u8;
6575 const ENCODED_LEN: usize = 9usize;
6576 fn deser(
6577 _version: MavlinkVersion,
6578 __input: &[u8],
6579 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6580 let avail_len = __input.len();
6581 let mut payload_buf = [0; Self::ENCODED_LEN];
6582 let mut buf = if avail_len < Self::ENCODED_LEN {
6583 payload_buf[0..avail_len].copy_from_slice(__input);
6584 Bytes::new(&payload_buf)
6585 } else {
6586 Bytes::new(__input)
6587 };
6588 let mut __struct = Self::default();
6589 __struct.time_boot_ms = buf.get_u32_le();
6590 __struct.last_change_ms = buf.get_u32_le();
6591 __struct.state = buf.get_u8();
6592 Ok(__struct)
6593 }
6594 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6595 let mut __tmp = BytesMut::new(bytes);
6596 #[allow(clippy::absurd_extreme_comparisons)]
6597 #[allow(unused_comparisons)]
6598 if __tmp.remaining() < Self::ENCODED_LEN {
6599 panic!(
6600 "buffer is too small (need {} bytes, but got {})",
6601 Self::ENCODED_LEN,
6602 __tmp.remaining(),
6603 )
6604 }
6605 __tmp.put_u32_le(self.time_boot_ms);
6606 __tmp.put_u32_le(self.last_change_ms);
6607 __tmp.put_u8(self.state);
6608 if matches!(version, MavlinkVersion::V2) {
6609 let len = __tmp.len();
6610 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6611 } else {
6612 __tmp.len()
6613 }
6614 }
6615}
6616#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6617#[doc = ""]
6618#[doc = "ID: 262"]
6619#[derive(Debug, Clone, PartialEq)]
6620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6622pub struct CAMERA_CAPTURE_STATUS_DATA {
6623 #[doc = "Timestamp (time since system boot)."]
6624 pub time_boot_ms: u32,
6625 #[doc = "Image capture interval"]
6626 pub image_interval: f32,
6627 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
6628 pub recording_time_ms: u32,
6629 #[doc = "Available storage capacity."]
6630 pub available_capacity: f32,
6631 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
6632 pub image_status: u8,
6633 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
6634 pub video_status: u8,
6635 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
6636 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6637 pub image_count: i32,
6638 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6639 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6640 pub camera_device_id: u8,
6641}
6642impl CAMERA_CAPTURE_STATUS_DATA {
6643 pub const ENCODED_LEN: usize = 23usize;
6644 pub const DEFAULT: Self = Self {
6645 time_boot_ms: 0_u32,
6646 image_interval: 0.0_f32,
6647 recording_time_ms: 0_u32,
6648 available_capacity: 0.0_f32,
6649 image_status: 0_u8,
6650 video_status: 0_u8,
6651 image_count: 0_i32,
6652 camera_device_id: 0_u8,
6653 };
6654 #[cfg(feature = "arbitrary")]
6655 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6656 use arbitrary::{Arbitrary, Unstructured};
6657 let mut buf = [0u8; 1024];
6658 rng.fill_bytes(&mut buf);
6659 let mut unstructured = Unstructured::new(&buf);
6660 Self::arbitrary(&mut unstructured).unwrap_or_default()
6661 }
6662}
6663impl Default for CAMERA_CAPTURE_STATUS_DATA {
6664 fn default() -> Self {
6665 Self::DEFAULT.clone()
6666 }
6667}
6668impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
6669 type Message = MavMessage;
6670 const ID: u32 = 262u32;
6671 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
6672 const EXTRA_CRC: u8 = 12u8;
6673 const ENCODED_LEN: usize = 23usize;
6674 fn deser(
6675 _version: MavlinkVersion,
6676 __input: &[u8],
6677 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6678 let avail_len = __input.len();
6679 let mut payload_buf = [0; Self::ENCODED_LEN];
6680 let mut buf = if avail_len < Self::ENCODED_LEN {
6681 payload_buf[0..avail_len].copy_from_slice(__input);
6682 Bytes::new(&payload_buf)
6683 } else {
6684 Bytes::new(__input)
6685 };
6686 let mut __struct = Self::default();
6687 __struct.time_boot_ms = buf.get_u32_le();
6688 __struct.image_interval = buf.get_f32_le();
6689 __struct.recording_time_ms = buf.get_u32_le();
6690 __struct.available_capacity = buf.get_f32_le();
6691 __struct.image_status = buf.get_u8();
6692 __struct.video_status = buf.get_u8();
6693 __struct.image_count = buf.get_i32_le();
6694 __struct.camera_device_id = buf.get_u8();
6695 Ok(__struct)
6696 }
6697 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6698 let mut __tmp = BytesMut::new(bytes);
6699 #[allow(clippy::absurd_extreme_comparisons)]
6700 #[allow(unused_comparisons)]
6701 if __tmp.remaining() < Self::ENCODED_LEN {
6702 panic!(
6703 "buffer is too small (need {} bytes, but got {})",
6704 Self::ENCODED_LEN,
6705 __tmp.remaining(),
6706 )
6707 }
6708 __tmp.put_u32_le(self.time_boot_ms);
6709 __tmp.put_f32_le(self.image_interval);
6710 __tmp.put_u32_le(self.recording_time_ms);
6711 __tmp.put_f32_le(self.available_capacity);
6712 __tmp.put_u8(self.image_status);
6713 __tmp.put_u8(self.video_status);
6714 if matches!(version, MavlinkVersion::V2) {
6715 __tmp.put_i32_le(self.image_count);
6716 __tmp.put_u8(self.camera_device_id);
6717 let len = __tmp.len();
6718 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6719 } else {
6720 __tmp.len()
6721 }
6722 }
6723}
6724#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6725#[doc = ""]
6726#[doc = "ID: 271"]
6727#[derive(Debug, Clone, PartialEq)]
6728#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6729#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6730pub struct CAMERA_FOV_STATUS_DATA {
6731 #[doc = "Timestamp (time since system boot)."]
6732 pub time_boot_ms: u32,
6733 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
6734 pub lat_camera: i32,
6735 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
6736 pub lon_camera: i32,
6737 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
6738 pub alt_camera: i32,
6739 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6740 pub lat_image: i32,
6741 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6742 pub lon_image: i32,
6743 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6744 pub alt_image: i32,
6745 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6746 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6747 pub q: [f32; 4],
6748 #[doc = "Horizontal field of view (NaN if unknown)."]
6749 pub hfov: f32,
6750 #[doc = "Vertical field of view (NaN if unknown)."]
6751 pub vfov: f32,
6752 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6753 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6754 pub camera_device_id: u8,
6755}
6756impl CAMERA_FOV_STATUS_DATA {
6757 pub const ENCODED_LEN: usize = 53usize;
6758 pub const DEFAULT: Self = Self {
6759 time_boot_ms: 0_u32,
6760 lat_camera: 0_i32,
6761 lon_camera: 0_i32,
6762 alt_camera: 0_i32,
6763 lat_image: 0_i32,
6764 lon_image: 0_i32,
6765 alt_image: 0_i32,
6766 q: [0.0_f32; 4usize],
6767 hfov: 0.0_f32,
6768 vfov: 0.0_f32,
6769 camera_device_id: 0_u8,
6770 };
6771 #[cfg(feature = "arbitrary")]
6772 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6773 use arbitrary::{Arbitrary, Unstructured};
6774 let mut buf = [0u8; 1024];
6775 rng.fill_bytes(&mut buf);
6776 let mut unstructured = Unstructured::new(&buf);
6777 Self::arbitrary(&mut unstructured).unwrap_or_default()
6778 }
6779}
6780impl Default for CAMERA_FOV_STATUS_DATA {
6781 fn default() -> Self {
6782 Self::DEFAULT.clone()
6783 }
6784}
6785impl MessageData for CAMERA_FOV_STATUS_DATA {
6786 type Message = MavMessage;
6787 const ID: u32 = 271u32;
6788 const NAME: &'static str = "CAMERA_FOV_STATUS";
6789 const EXTRA_CRC: u8 = 22u8;
6790 const ENCODED_LEN: usize = 53usize;
6791 fn deser(
6792 _version: MavlinkVersion,
6793 __input: &[u8],
6794 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6795 let avail_len = __input.len();
6796 let mut payload_buf = [0; Self::ENCODED_LEN];
6797 let mut buf = if avail_len < Self::ENCODED_LEN {
6798 payload_buf[0..avail_len].copy_from_slice(__input);
6799 Bytes::new(&payload_buf)
6800 } else {
6801 Bytes::new(__input)
6802 };
6803 let mut __struct = Self::default();
6804 __struct.time_boot_ms = buf.get_u32_le();
6805 __struct.lat_camera = buf.get_i32_le();
6806 __struct.lon_camera = buf.get_i32_le();
6807 __struct.alt_camera = buf.get_i32_le();
6808 __struct.lat_image = buf.get_i32_le();
6809 __struct.lon_image = buf.get_i32_le();
6810 __struct.alt_image = buf.get_i32_le();
6811 for v in &mut __struct.q {
6812 let val = buf.get_f32_le();
6813 *v = val;
6814 }
6815 __struct.hfov = buf.get_f32_le();
6816 __struct.vfov = buf.get_f32_le();
6817 __struct.camera_device_id = buf.get_u8();
6818 Ok(__struct)
6819 }
6820 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6821 let mut __tmp = BytesMut::new(bytes);
6822 #[allow(clippy::absurd_extreme_comparisons)]
6823 #[allow(unused_comparisons)]
6824 if __tmp.remaining() < Self::ENCODED_LEN {
6825 panic!(
6826 "buffer is too small (need {} bytes, but got {})",
6827 Self::ENCODED_LEN,
6828 __tmp.remaining(),
6829 )
6830 }
6831 __tmp.put_u32_le(self.time_boot_ms);
6832 __tmp.put_i32_le(self.lat_camera);
6833 __tmp.put_i32_le(self.lon_camera);
6834 __tmp.put_i32_le(self.alt_camera);
6835 __tmp.put_i32_le(self.lat_image);
6836 __tmp.put_i32_le(self.lon_image);
6837 __tmp.put_i32_le(self.alt_image);
6838 for val in &self.q {
6839 __tmp.put_f32_le(*val);
6840 }
6841 __tmp.put_f32_le(self.hfov);
6842 __tmp.put_f32_le(self.vfov);
6843 if matches!(version, MavlinkVersion::V2) {
6844 __tmp.put_u8(self.camera_device_id);
6845 let len = __tmp.len();
6846 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6847 } else {
6848 __tmp.len()
6849 }
6850 }
6851}
6852#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
6853#[doc = ""]
6854#[doc = "ID: 263"]
6855#[derive(Debug, Clone, PartialEq)]
6856#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6857#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6858pub struct CAMERA_IMAGE_CAPTURED_DATA {
6859 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
6860 pub time_utc: u64,
6861 #[doc = "Timestamp (time since system boot)."]
6862 pub time_boot_ms: u32,
6863 #[doc = "Latitude where image was taken"]
6864 pub lat: i32,
6865 #[doc = "Longitude where capture was taken"]
6866 pub lon: i32,
6867 #[doc = "Altitude (MSL) where image was taken"]
6868 pub alt: i32,
6869 #[doc = "Altitude above ground"]
6870 pub relative_alt: i32,
6871 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6872 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6873 pub q: [f32; 4],
6874 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
6875 pub image_index: i32,
6876 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
6877 pub camera_id: u8,
6878 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
6879 pub capture_result: i8,
6880 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
6881 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6882 pub file_url: [u8; 205],
6883}
6884impl CAMERA_IMAGE_CAPTURED_DATA {
6885 pub const ENCODED_LEN: usize = 255usize;
6886 pub const DEFAULT: Self = Self {
6887 time_utc: 0_u64,
6888 time_boot_ms: 0_u32,
6889 lat: 0_i32,
6890 lon: 0_i32,
6891 alt: 0_i32,
6892 relative_alt: 0_i32,
6893 q: [0.0_f32; 4usize],
6894 image_index: 0_i32,
6895 camera_id: 0_u8,
6896 capture_result: 0_i8,
6897 file_url: [0_u8; 205usize],
6898 };
6899 #[cfg(feature = "arbitrary")]
6900 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6901 use arbitrary::{Arbitrary, Unstructured};
6902 let mut buf = [0u8; 1024];
6903 rng.fill_bytes(&mut buf);
6904 let mut unstructured = Unstructured::new(&buf);
6905 Self::arbitrary(&mut unstructured).unwrap_or_default()
6906 }
6907}
6908impl Default for CAMERA_IMAGE_CAPTURED_DATA {
6909 fn default() -> Self {
6910 Self::DEFAULT.clone()
6911 }
6912}
6913impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
6914 type Message = MavMessage;
6915 const ID: u32 = 263u32;
6916 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
6917 const EXTRA_CRC: u8 = 133u8;
6918 const ENCODED_LEN: usize = 255usize;
6919 fn deser(
6920 _version: MavlinkVersion,
6921 __input: &[u8],
6922 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6923 let avail_len = __input.len();
6924 let mut payload_buf = [0; Self::ENCODED_LEN];
6925 let mut buf = if avail_len < Self::ENCODED_LEN {
6926 payload_buf[0..avail_len].copy_from_slice(__input);
6927 Bytes::new(&payload_buf)
6928 } else {
6929 Bytes::new(__input)
6930 };
6931 let mut __struct = Self::default();
6932 __struct.time_utc = buf.get_u64_le();
6933 __struct.time_boot_ms = buf.get_u32_le();
6934 __struct.lat = buf.get_i32_le();
6935 __struct.lon = buf.get_i32_le();
6936 __struct.alt = buf.get_i32_le();
6937 __struct.relative_alt = buf.get_i32_le();
6938 for v in &mut __struct.q {
6939 let val = buf.get_f32_le();
6940 *v = val;
6941 }
6942 __struct.image_index = buf.get_i32_le();
6943 __struct.camera_id = buf.get_u8();
6944 __struct.capture_result = buf.get_i8();
6945 for v in &mut __struct.file_url {
6946 let val = buf.get_u8();
6947 *v = val;
6948 }
6949 Ok(__struct)
6950 }
6951 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6952 let mut __tmp = BytesMut::new(bytes);
6953 #[allow(clippy::absurd_extreme_comparisons)]
6954 #[allow(unused_comparisons)]
6955 if __tmp.remaining() < Self::ENCODED_LEN {
6956 panic!(
6957 "buffer is too small (need {} bytes, but got {})",
6958 Self::ENCODED_LEN,
6959 __tmp.remaining(),
6960 )
6961 }
6962 __tmp.put_u64_le(self.time_utc);
6963 __tmp.put_u32_le(self.time_boot_ms);
6964 __tmp.put_i32_le(self.lat);
6965 __tmp.put_i32_le(self.lon);
6966 __tmp.put_i32_le(self.alt);
6967 __tmp.put_i32_le(self.relative_alt);
6968 for val in &self.q {
6969 __tmp.put_f32_le(*val);
6970 }
6971 __tmp.put_i32_le(self.image_index);
6972 __tmp.put_u8(self.camera_id);
6973 __tmp.put_i8(self.capture_result);
6974 for val in &self.file_url {
6975 __tmp.put_u8(*val);
6976 }
6977 if matches!(version, MavlinkVersion::V2) {
6978 let len = __tmp.len();
6979 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6980 } else {
6981 __tmp.len()
6982 }
6983 }
6984}
6985#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6986#[doc = ""]
6987#[doc = "ID: 259"]
6988#[derive(Debug, Clone, PartialEq)]
6989#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6990#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6991pub struct CAMERA_INFORMATION_DATA {
6992 #[doc = "Timestamp (time since system boot)."]
6993 pub time_boot_ms: u32,
6994 #[doc = "0xff). Use 0 if not known."]
6995 pub firmware_version: u32,
6996 #[doc = "Focal length. Use NaN if not known."]
6997 pub focal_length: f32,
6998 #[doc = "Image sensor size horizontal. Use NaN if not known."]
6999 pub sensor_size_h: f32,
7000 #[doc = "Image sensor size vertical. Use NaN if not known."]
7001 pub sensor_size_v: f32,
7002 #[doc = "Bitmap of camera capability flags."]
7003 pub flags: CameraCapFlags,
7004 #[doc = "Horizontal image resolution. Use 0 if not known."]
7005 pub resolution_h: u16,
7006 #[doc = "Vertical image resolution. Use 0 if not known."]
7007 pub resolution_v: u16,
7008 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7009 pub cam_definition_version: u16,
7010 #[doc = "Name of the camera vendor"]
7011 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7012 pub vendor_name: [u8; 32],
7013 #[doc = "Name of the camera model"]
7014 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7015 pub model_name: [u8; 32],
7016 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7017 pub lens_id: u8,
7018 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7019 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7020 pub cam_definition_uri: [u8; 140],
7021 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7022 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7023 pub gimbal_device_id: u8,
7024 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7025 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7026 pub camera_device_id: u8,
7027}
7028impl CAMERA_INFORMATION_DATA {
7029 pub const ENCODED_LEN: usize = 237usize;
7030 pub const DEFAULT: Self = Self {
7031 time_boot_ms: 0_u32,
7032 firmware_version: 0_u32,
7033 focal_length: 0.0_f32,
7034 sensor_size_h: 0.0_f32,
7035 sensor_size_v: 0.0_f32,
7036 flags: CameraCapFlags::DEFAULT,
7037 resolution_h: 0_u16,
7038 resolution_v: 0_u16,
7039 cam_definition_version: 0_u16,
7040 vendor_name: [0_u8; 32usize],
7041 model_name: [0_u8; 32usize],
7042 lens_id: 0_u8,
7043 cam_definition_uri: [0_u8; 140usize],
7044 gimbal_device_id: 0_u8,
7045 camera_device_id: 0_u8,
7046 };
7047 #[cfg(feature = "arbitrary")]
7048 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7049 use arbitrary::{Arbitrary, Unstructured};
7050 let mut buf = [0u8; 1024];
7051 rng.fill_bytes(&mut buf);
7052 let mut unstructured = Unstructured::new(&buf);
7053 Self::arbitrary(&mut unstructured).unwrap_or_default()
7054 }
7055}
7056impl Default for CAMERA_INFORMATION_DATA {
7057 fn default() -> Self {
7058 Self::DEFAULT.clone()
7059 }
7060}
7061impl MessageData for CAMERA_INFORMATION_DATA {
7062 type Message = MavMessage;
7063 const ID: u32 = 259u32;
7064 const NAME: &'static str = "CAMERA_INFORMATION";
7065 const EXTRA_CRC: u8 = 92u8;
7066 const ENCODED_LEN: usize = 237usize;
7067 fn deser(
7068 _version: MavlinkVersion,
7069 __input: &[u8],
7070 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7071 let avail_len = __input.len();
7072 let mut payload_buf = [0; Self::ENCODED_LEN];
7073 let mut buf = if avail_len < Self::ENCODED_LEN {
7074 payload_buf[0..avail_len].copy_from_slice(__input);
7075 Bytes::new(&payload_buf)
7076 } else {
7077 Bytes::new(__input)
7078 };
7079 let mut __struct = Self::default();
7080 __struct.time_boot_ms = buf.get_u32_le();
7081 __struct.firmware_version = buf.get_u32_le();
7082 __struct.focal_length = buf.get_f32_le();
7083 __struct.sensor_size_h = buf.get_f32_le();
7084 __struct.sensor_size_v = buf.get_f32_le();
7085 let tmp = buf.get_u32_le();
7086 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7087 ::mavlink_core::error::ParserError::InvalidFlag {
7088 flag_type: "CameraCapFlags",
7089 value: tmp as u32,
7090 },
7091 )?;
7092 __struct.resolution_h = buf.get_u16_le();
7093 __struct.resolution_v = buf.get_u16_le();
7094 __struct.cam_definition_version = buf.get_u16_le();
7095 for v in &mut __struct.vendor_name {
7096 let val = buf.get_u8();
7097 *v = val;
7098 }
7099 for v in &mut __struct.model_name {
7100 let val = buf.get_u8();
7101 *v = val;
7102 }
7103 __struct.lens_id = buf.get_u8();
7104 for v in &mut __struct.cam_definition_uri {
7105 let val = buf.get_u8();
7106 *v = val;
7107 }
7108 __struct.gimbal_device_id = buf.get_u8();
7109 __struct.camera_device_id = buf.get_u8();
7110 Ok(__struct)
7111 }
7112 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7113 let mut __tmp = BytesMut::new(bytes);
7114 #[allow(clippy::absurd_extreme_comparisons)]
7115 #[allow(unused_comparisons)]
7116 if __tmp.remaining() < Self::ENCODED_LEN {
7117 panic!(
7118 "buffer is too small (need {} bytes, but got {})",
7119 Self::ENCODED_LEN,
7120 __tmp.remaining(),
7121 )
7122 }
7123 __tmp.put_u32_le(self.time_boot_ms);
7124 __tmp.put_u32_le(self.firmware_version);
7125 __tmp.put_f32_le(self.focal_length);
7126 __tmp.put_f32_le(self.sensor_size_h);
7127 __tmp.put_f32_le(self.sensor_size_v);
7128 __tmp.put_u32_le(self.flags.bits());
7129 __tmp.put_u16_le(self.resolution_h);
7130 __tmp.put_u16_le(self.resolution_v);
7131 __tmp.put_u16_le(self.cam_definition_version);
7132 for val in &self.vendor_name {
7133 __tmp.put_u8(*val);
7134 }
7135 for val in &self.model_name {
7136 __tmp.put_u8(*val);
7137 }
7138 __tmp.put_u8(self.lens_id);
7139 for val in &self.cam_definition_uri {
7140 __tmp.put_u8(*val);
7141 }
7142 if matches!(version, MavlinkVersion::V2) {
7143 __tmp.put_u8(self.gimbal_device_id);
7144 __tmp.put_u8(self.camera_device_id);
7145 let len = __tmp.len();
7146 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7147 } else {
7148 __tmp.len()
7149 }
7150 }
7151}
7152#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7153#[doc = ""]
7154#[doc = "ID: 260"]
7155#[derive(Debug, Clone, PartialEq)]
7156#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7157#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7158pub struct CAMERA_SETTINGS_DATA {
7159 #[doc = "Timestamp (time since system boot)."]
7160 pub time_boot_ms: u32,
7161 #[doc = "Camera mode"]
7162 pub mode_id: CameraMode,
7163 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7164 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7165 pub zoomLevel: f32,
7166 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7167 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7168 pub focusLevel: f32,
7169 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7170 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7171 pub camera_device_id: u8,
7172}
7173impl CAMERA_SETTINGS_DATA {
7174 pub const ENCODED_LEN: usize = 14usize;
7175 pub const DEFAULT: Self = Self {
7176 time_boot_ms: 0_u32,
7177 mode_id: CameraMode::DEFAULT,
7178 zoomLevel: 0.0_f32,
7179 focusLevel: 0.0_f32,
7180 camera_device_id: 0_u8,
7181 };
7182 #[cfg(feature = "arbitrary")]
7183 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7184 use arbitrary::{Arbitrary, Unstructured};
7185 let mut buf = [0u8; 1024];
7186 rng.fill_bytes(&mut buf);
7187 let mut unstructured = Unstructured::new(&buf);
7188 Self::arbitrary(&mut unstructured).unwrap_or_default()
7189 }
7190}
7191impl Default for CAMERA_SETTINGS_DATA {
7192 fn default() -> Self {
7193 Self::DEFAULT.clone()
7194 }
7195}
7196impl MessageData for CAMERA_SETTINGS_DATA {
7197 type Message = MavMessage;
7198 const ID: u32 = 260u32;
7199 const NAME: &'static str = "CAMERA_SETTINGS";
7200 const EXTRA_CRC: u8 = 146u8;
7201 const ENCODED_LEN: usize = 14usize;
7202 fn deser(
7203 _version: MavlinkVersion,
7204 __input: &[u8],
7205 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7206 let avail_len = __input.len();
7207 let mut payload_buf = [0; Self::ENCODED_LEN];
7208 let mut buf = if avail_len < Self::ENCODED_LEN {
7209 payload_buf[0..avail_len].copy_from_slice(__input);
7210 Bytes::new(&payload_buf)
7211 } else {
7212 Bytes::new(__input)
7213 };
7214 let mut __struct = Self::default();
7215 __struct.time_boot_ms = buf.get_u32_le();
7216 let tmp = buf.get_u8();
7217 __struct.mode_id =
7218 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7219 enum_type: "CameraMode",
7220 value: tmp as u32,
7221 })?;
7222 __struct.zoomLevel = buf.get_f32_le();
7223 __struct.focusLevel = buf.get_f32_le();
7224 __struct.camera_device_id = buf.get_u8();
7225 Ok(__struct)
7226 }
7227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7228 let mut __tmp = BytesMut::new(bytes);
7229 #[allow(clippy::absurd_extreme_comparisons)]
7230 #[allow(unused_comparisons)]
7231 if __tmp.remaining() < Self::ENCODED_LEN {
7232 panic!(
7233 "buffer is too small (need {} bytes, but got {})",
7234 Self::ENCODED_LEN,
7235 __tmp.remaining(),
7236 )
7237 }
7238 __tmp.put_u32_le(self.time_boot_ms);
7239 __tmp.put_u8(self.mode_id as u8);
7240 if matches!(version, MavlinkVersion::V2) {
7241 __tmp.put_f32_le(self.zoomLevel);
7242 __tmp.put_f32_le(self.focusLevel);
7243 __tmp.put_u8(self.camera_device_id);
7244 let len = __tmp.len();
7245 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7246 } else {
7247 __tmp.len()
7248 }
7249 }
7250}
7251#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7252#[doc = ""]
7253#[doc = "ID: 277"]
7254#[derive(Debug, Clone, PartialEq)]
7255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7256#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7257pub struct CAMERA_THERMAL_RANGE_DATA {
7258 #[doc = "Timestamp (time since system boot)."]
7259 pub time_boot_ms: u32,
7260 #[doc = "Temperature max."]
7261 pub max: f32,
7262 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7263 pub max_point_x: f32,
7264 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7265 pub max_point_y: f32,
7266 #[doc = "Temperature min."]
7267 pub min: f32,
7268 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7269 pub min_point_x: f32,
7270 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7271 pub min_point_y: f32,
7272 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7273 pub stream_id: u8,
7274 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7275 pub camera_device_id: u8,
7276}
7277impl CAMERA_THERMAL_RANGE_DATA {
7278 pub const ENCODED_LEN: usize = 30usize;
7279 pub const DEFAULT: Self = Self {
7280 time_boot_ms: 0_u32,
7281 max: 0.0_f32,
7282 max_point_x: 0.0_f32,
7283 max_point_y: 0.0_f32,
7284 min: 0.0_f32,
7285 min_point_x: 0.0_f32,
7286 min_point_y: 0.0_f32,
7287 stream_id: 0_u8,
7288 camera_device_id: 0_u8,
7289 };
7290 #[cfg(feature = "arbitrary")]
7291 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7292 use arbitrary::{Arbitrary, Unstructured};
7293 let mut buf = [0u8; 1024];
7294 rng.fill_bytes(&mut buf);
7295 let mut unstructured = Unstructured::new(&buf);
7296 Self::arbitrary(&mut unstructured).unwrap_or_default()
7297 }
7298}
7299impl Default for CAMERA_THERMAL_RANGE_DATA {
7300 fn default() -> Self {
7301 Self::DEFAULT.clone()
7302 }
7303}
7304impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7305 type Message = MavMessage;
7306 const ID: u32 = 277u32;
7307 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7308 const EXTRA_CRC: u8 = 62u8;
7309 const ENCODED_LEN: usize = 30usize;
7310 fn deser(
7311 _version: MavlinkVersion,
7312 __input: &[u8],
7313 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7314 let avail_len = __input.len();
7315 let mut payload_buf = [0; Self::ENCODED_LEN];
7316 let mut buf = if avail_len < Self::ENCODED_LEN {
7317 payload_buf[0..avail_len].copy_from_slice(__input);
7318 Bytes::new(&payload_buf)
7319 } else {
7320 Bytes::new(__input)
7321 };
7322 let mut __struct = Self::default();
7323 __struct.time_boot_ms = buf.get_u32_le();
7324 __struct.max = buf.get_f32_le();
7325 __struct.max_point_x = buf.get_f32_le();
7326 __struct.max_point_y = buf.get_f32_le();
7327 __struct.min = buf.get_f32_le();
7328 __struct.min_point_x = buf.get_f32_le();
7329 __struct.min_point_y = buf.get_f32_le();
7330 __struct.stream_id = buf.get_u8();
7331 __struct.camera_device_id = buf.get_u8();
7332 Ok(__struct)
7333 }
7334 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7335 let mut __tmp = BytesMut::new(bytes);
7336 #[allow(clippy::absurd_extreme_comparisons)]
7337 #[allow(unused_comparisons)]
7338 if __tmp.remaining() < Self::ENCODED_LEN {
7339 panic!(
7340 "buffer is too small (need {} bytes, but got {})",
7341 Self::ENCODED_LEN,
7342 __tmp.remaining(),
7343 )
7344 }
7345 __tmp.put_u32_le(self.time_boot_ms);
7346 __tmp.put_f32_le(self.max);
7347 __tmp.put_f32_le(self.max_point_x);
7348 __tmp.put_f32_le(self.max_point_y);
7349 __tmp.put_f32_le(self.min);
7350 __tmp.put_f32_le(self.min_point_x);
7351 __tmp.put_f32_le(self.min_point_y);
7352 __tmp.put_u8(self.stream_id);
7353 __tmp.put_u8(self.camera_device_id);
7354 if matches!(version, MavlinkVersion::V2) {
7355 let len = __tmp.len();
7356 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7357 } else {
7358 __tmp.len()
7359 }
7360 }
7361}
7362#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7363#[doc = ""]
7364#[doc = "ID: 276"]
7365#[derive(Debug, Clone, PartialEq)]
7366#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7368pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7369 #[doc = "Latitude of tracked object"]
7370 pub lat: i32,
7371 #[doc = "Longitude of tracked object"]
7372 pub lon: i32,
7373 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7374 pub alt: f32,
7375 #[doc = "Horizontal accuracy. NAN if unknown"]
7376 pub h_acc: f32,
7377 #[doc = "Vertical accuracy. NAN if unknown"]
7378 pub v_acc: f32,
7379 #[doc = "North velocity of tracked object. NAN if unknown"]
7380 pub vel_n: f32,
7381 #[doc = "East velocity of tracked object. NAN if unknown"]
7382 pub vel_e: f32,
7383 #[doc = "Down velocity of tracked object. NAN if unknown"]
7384 pub vel_d: f32,
7385 #[doc = "Velocity accuracy. NAN if unknown"]
7386 pub vel_acc: f32,
7387 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7388 pub dist: f32,
7389 #[doc = "Heading in radians, in NED. NAN if unknown"]
7390 pub hdg: f32,
7391 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7392 pub hdg_acc: f32,
7393 #[doc = "Current tracking status"]
7394 pub tracking_status: CameraTrackingStatusFlags,
7395 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7396 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7397 pub camera_device_id: u8,
7398}
7399impl CAMERA_TRACKING_GEO_STATUS_DATA {
7400 pub const ENCODED_LEN: usize = 50usize;
7401 pub const DEFAULT: Self = Self {
7402 lat: 0_i32,
7403 lon: 0_i32,
7404 alt: 0.0_f32,
7405 h_acc: 0.0_f32,
7406 v_acc: 0.0_f32,
7407 vel_n: 0.0_f32,
7408 vel_e: 0.0_f32,
7409 vel_d: 0.0_f32,
7410 vel_acc: 0.0_f32,
7411 dist: 0.0_f32,
7412 hdg: 0.0_f32,
7413 hdg_acc: 0.0_f32,
7414 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7415 camera_device_id: 0_u8,
7416 };
7417 #[cfg(feature = "arbitrary")]
7418 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7419 use arbitrary::{Arbitrary, Unstructured};
7420 let mut buf = [0u8; 1024];
7421 rng.fill_bytes(&mut buf);
7422 let mut unstructured = Unstructured::new(&buf);
7423 Self::arbitrary(&mut unstructured).unwrap_or_default()
7424 }
7425}
7426impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7427 fn default() -> Self {
7428 Self::DEFAULT.clone()
7429 }
7430}
7431impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7432 type Message = MavMessage;
7433 const ID: u32 = 276u32;
7434 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7435 const EXTRA_CRC: u8 = 18u8;
7436 const ENCODED_LEN: usize = 50usize;
7437 fn deser(
7438 _version: MavlinkVersion,
7439 __input: &[u8],
7440 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7441 let avail_len = __input.len();
7442 let mut payload_buf = [0; Self::ENCODED_LEN];
7443 let mut buf = if avail_len < Self::ENCODED_LEN {
7444 payload_buf[0..avail_len].copy_from_slice(__input);
7445 Bytes::new(&payload_buf)
7446 } else {
7447 Bytes::new(__input)
7448 };
7449 let mut __struct = Self::default();
7450 __struct.lat = buf.get_i32_le();
7451 __struct.lon = buf.get_i32_le();
7452 __struct.alt = buf.get_f32_le();
7453 __struct.h_acc = buf.get_f32_le();
7454 __struct.v_acc = buf.get_f32_le();
7455 __struct.vel_n = buf.get_f32_le();
7456 __struct.vel_e = buf.get_f32_le();
7457 __struct.vel_d = buf.get_f32_le();
7458 __struct.vel_acc = buf.get_f32_le();
7459 __struct.dist = buf.get_f32_le();
7460 __struct.hdg = buf.get_f32_le();
7461 __struct.hdg_acc = buf.get_f32_le();
7462 let tmp = buf.get_u8();
7463 __struct.tracking_status =
7464 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7465 enum_type: "CameraTrackingStatusFlags",
7466 value: tmp as u32,
7467 })?;
7468 __struct.camera_device_id = buf.get_u8();
7469 Ok(__struct)
7470 }
7471 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7472 let mut __tmp = BytesMut::new(bytes);
7473 #[allow(clippy::absurd_extreme_comparisons)]
7474 #[allow(unused_comparisons)]
7475 if __tmp.remaining() < Self::ENCODED_LEN {
7476 panic!(
7477 "buffer is too small (need {} bytes, but got {})",
7478 Self::ENCODED_LEN,
7479 __tmp.remaining(),
7480 )
7481 }
7482 __tmp.put_i32_le(self.lat);
7483 __tmp.put_i32_le(self.lon);
7484 __tmp.put_f32_le(self.alt);
7485 __tmp.put_f32_le(self.h_acc);
7486 __tmp.put_f32_le(self.v_acc);
7487 __tmp.put_f32_le(self.vel_n);
7488 __tmp.put_f32_le(self.vel_e);
7489 __tmp.put_f32_le(self.vel_d);
7490 __tmp.put_f32_le(self.vel_acc);
7491 __tmp.put_f32_le(self.dist);
7492 __tmp.put_f32_le(self.hdg);
7493 __tmp.put_f32_le(self.hdg_acc);
7494 __tmp.put_u8(self.tracking_status as u8);
7495 if matches!(version, MavlinkVersion::V2) {
7496 __tmp.put_u8(self.camera_device_id);
7497 let len = __tmp.len();
7498 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7499 } else {
7500 __tmp.len()
7501 }
7502 }
7503}
7504#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7505#[doc = ""]
7506#[doc = "ID: 275"]
7507#[derive(Debug, Clone, PartialEq)]
7508#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7509#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7510pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7511 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7512 pub point_x: f32,
7513 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7514 pub point_y: f32,
7515 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7516 pub radius: f32,
7517 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7518 pub rec_top_x: f32,
7519 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7520 pub rec_top_y: f32,
7521 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7522 pub rec_bottom_x: f32,
7523 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7524 pub rec_bottom_y: f32,
7525 #[doc = "Current tracking status"]
7526 pub tracking_status: CameraTrackingStatusFlags,
7527 #[doc = "Current tracking mode"]
7528 pub tracking_mode: CameraTrackingMode,
7529 #[doc = "Defines location of target data"]
7530 pub target_data: CameraTrackingTargetData,
7531 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7532 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7533 pub camera_device_id: u8,
7534}
7535impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7536 pub const ENCODED_LEN: usize = 32usize;
7537 pub const DEFAULT: Self = Self {
7538 point_x: 0.0_f32,
7539 point_y: 0.0_f32,
7540 radius: 0.0_f32,
7541 rec_top_x: 0.0_f32,
7542 rec_top_y: 0.0_f32,
7543 rec_bottom_x: 0.0_f32,
7544 rec_bottom_y: 0.0_f32,
7545 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7546 tracking_mode: CameraTrackingMode::DEFAULT,
7547 target_data: CameraTrackingTargetData::DEFAULT,
7548 camera_device_id: 0_u8,
7549 };
7550 #[cfg(feature = "arbitrary")]
7551 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7552 use arbitrary::{Arbitrary, Unstructured};
7553 let mut buf = [0u8; 1024];
7554 rng.fill_bytes(&mut buf);
7555 let mut unstructured = Unstructured::new(&buf);
7556 Self::arbitrary(&mut unstructured).unwrap_or_default()
7557 }
7558}
7559impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7560 fn default() -> Self {
7561 Self::DEFAULT.clone()
7562 }
7563}
7564impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7565 type Message = MavMessage;
7566 const ID: u32 = 275u32;
7567 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
7568 const EXTRA_CRC: u8 = 126u8;
7569 const ENCODED_LEN: usize = 32usize;
7570 fn deser(
7571 _version: MavlinkVersion,
7572 __input: &[u8],
7573 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7574 let avail_len = __input.len();
7575 let mut payload_buf = [0; Self::ENCODED_LEN];
7576 let mut buf = if avail_len < Self::ENCODED_LEN {
7577 payload_buf[0..avail_len].copy_from_slice(__input);
7578 Bytes::new(&payload_buf)
7579 } else {
7580 Bytes::new(__input)
7581 };
7582 let mut __struct = Self::default();
7583 __struct.point_x = buf.get_f32_le();
7584 __struct.point_y = buf.get_f32_le();
7585 __struct.radius = buf.get_f32_le();
7586 __struct.rec_top_x = buf.get_f32_le();
7587 __struct.rec_top_y = buf.get_f32_le();
7588 __struct.rec_bottom_x = buf.get_f32_le();
7589 __struct.rec_bottom_y = buf.get_f32_le();
7590 let tmp = buf.get_u8();
7591 __struct.tracking_status =
7592 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7593 enum_type: "CameraTrackingStatusFlags",
7594 value: tmp as u32,
7595 })?;
7596 let tmp = buf.get_u8();
7597 __struct.tracking_mode =
7598 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7599 enum_type: "CameraTrackingMode",
7600 value: tmp as u32,
7601 })?;
7602 let tmp = buf.get_u8();
7603 __struct.target_data =
7604 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
7605 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7606 flag_type: "CameraTrackingTargetData",
7607 value: tmp as u32,
7608 })?;
7609 __struct.camera_device_id = buf.get_u8();
7610 Ok(__struct)
7611 }
7612 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7613 let mut __tmp = BytesMut::new(bytes);
7614 #[allow(clippy::absurd_extreme_comparisons)]
7615 #[allow(unused_comparisons)]
7616 if __tmp.remaining() < Self::ENCODED_LEN {
7617 panic!(
7618 "buffer is too small (need {} bytes, but got {})",
7619 Self::ENCODED_LEN,
7620 __tmp.remaining(),
7621 )
7622 }
7623 __tmp.put_f32_le(self.point_x);
7624 __tmp.put_f32_le(self.point_y);
7625 __tmp.put_f32_le(self.radius);
7626 __tmp.put_f32_le(self.rec_top_x);
7627 __tmp.put_f32_le(self.rec_top_y);
7628 __tmp.put_f32_le(self.rec_bottom_x);
7629 __tmp.put_f32_le(self.rec_bottom_y);
7630 __tmp.put_u8(self.tracking_status as u8);
7631 __tmp.put_u8(self.tracking_mode as u8);
7632 __tmp.put_u8(self.target_data.bits());
7633 if matches!(version, MavlinkVersion::V2) {
7634 __tmp.put_u8(self.camera_device_id);
7635 let len = __tmp.len();
7636 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7637 } else {
7638 __tmp.len()
7639 }
7640 }
7641}
7642#[doc = "Camera-IMU triggering and synchronisation message."]
7643#[doc = ""]
7644#[doc = "ID: 112"]
7645#[derive(Debug, Clone, PartialEq)]
7646#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7647#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7648pub struct CAMERA_TRIGGER_DATA {
7649 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7650 pub time_usec: u64,
7651 #[doc = "Image frame sequence"]
7652 pub seq: u32,
7653}
7654impl CAMERA_TRIGGER_DATA {
7655 pub const ENCODED_LEN: usize = 12usize;
7656 pub const DEFAULT: Self = Self {
7657 time_usec: 0_u64,
7658 seq: 0_u32,
7659 };
7660 #[cfg(feature = "arbitrary")]
7661 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7662 use arbitrary::{Arbitrary, Unstructured};
7663 let mut buf = [0u8; 1024];
7664 rng.fill_bytes(&mut buf);
7665 let mut unstructured = Unstructured::new(&buf);
7666 Self::arbitrary(&mut unstructured).unwrap_or_default()
7667 }
7668}
7669impl Default for CAMERA_TRIGGER_DATA {
7670 fn default() -> Self {
7671 Self::DEFAULT.clone()
7672 }
7673}
7674impl MessageData for CAMERA_TRIGGER_DATA {
7675 type Message = MavMessage;
7676 const ID: u32 = 112u32;
7677 const NAME: &'static str = "CAMERA_TRIGGER";
7678 const EXTRA_CRC: u8 = 174u8;
7679 const ENCODED_LEN: usize = 12usize;
7680 fn deser(
7681 _version: MavlinkVersion,
7682 __input: &[u8],
7683 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7684 let avail_len = __input.len();
7685 let mut payload_buf = [0; Self::ENCODED_LEN];
7686 let mut buf = if avail_len < Self::ENCODED_LEN {
7687 payload_buf[0..avail_len].copy_from_slice(__input);
7688 Bytes::new(&payload_buf)
7689 } else {
7690 Bytes::new(__input)
7691 };
7692 let mut __struct = Self::default();
7693 __struct.time_usec = buf.get_u64_le();
7694 __struct.seq = buf.get_u32_le();
7695 Ok(__struct)
7696 }
7697 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7698 let mut __tmp = BytesMut::new(bytes);
7699 #[allow(clippy::absurd_extreme_comparisons)]
7700 #[allow(unused_comparisons)]
7701 if __tmp.remaining() < Self::ENCODED_LEN {
7702 panic!(
7703 "buffer is too small (need {} bytes, but got {})",
7704 Self::ENCODED_LEN,
7705 __tmp.remaining(),
7706 )
7707 }
7708 __tmp.put_u64_le(self.time_usec);
7709 __tmp.put_u32_le(self.seq);
7710 if matches!(version, MavlinkVersion::V2) {
7711 let len = __tmp.len();
7712 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7713 } else {
7714 __tmp.len()
7715 }
7716 }
7717}
7718#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
7719#[doc = ""]
7720#[doc = "ID: 387"]
7721#[derive(Debug, Clone, PartialEq)]
7722#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7723#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7724pub struct CANFD_FRAME_DATA {
7725 #[doc = "Frame ID"]
7726 pub id: u32,
7727 #[doc = "System ID."]
7728 pub target_system: u8,
7729 #[doc = "Component ID."]
7730 pub target_component: u8,
7731 #[doc = "bus number"]
7732 pub bus: u8,
7733 #[doc = "Frame length"]
7734 pub len: u8,
7735 #[doc = "Frame data"]
7736 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7737 pub data: [u8; 64],
7738}
7739impl CANFD_FRAME_DATA {
7740 pub const ENCODED_LEN: usize = 72usize;
7741 pub const DEFAULT: Self = Self {
7742 id: 0_u32,
7743 target_system: 0_u8,
7744 target_component: 0_u8,
7745 bus: 0_u8,
7746 len: 0_u8,
7747 data: [0_u8; 64usize],
7748 };
7749 #[cfg(feature = "arbitrary")]
7750 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7751 use arbitrary::{Arbitrary, Unstructured};
7752 let mut buf = [0u8; 1024];
7753 rng.fill_bytes(&mut buf);
7754 let mut unstructured = Unstructured::new(&buf);
7755 Self::arbitrary(&mut unstructured).unwrap_or_default()
7756 }
7757}
7758impl Default for CANFD_FRAME_DATA {
7759 fn default() -> Self {
7760 Self::DEFAULT.clone()
7761 }
7762}
7763impl MessageData for CANFD_FRAME_DATA {
7764 type Message = MavMessage;
7765 const ID: u32 = 387u32;
7766 const NAME: &'static str = "CANFD_FRAME";
7767 const EXTRA_CRC: u8 = 4u8;
7768 const ENCODED_LEN: usize = 72usize;
7769 fn deser(
7770 _version: MavlinkVersion,
7771 __input: &[u8],
7772 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7773 let avail_len = __input.len();
7774 let mut payload_buf = [0; Self::ENCODED_LEN];
7775 let mut buf = if avail_len < Self::ENCODED_LEN {
7776 payload_buf[0..avail_len].copy_from_slice(__input);
7777 Bytes::new(&payload_buf)
7778 } else {
7779 Bytes::new(__input)
7780 };
7781 let mut __struct = Self::default();
7782 __struct.id = buf.get_u32_le();
7783 __struct.target_system = buf.get_u8();
7784 __struct.target_component = buf.get_u8();
7785 __struct.bus = buf.get_u8();
7786 __struct.len = buf.get_u8();
7787 for v in &mut __struct.data {
7788 let val = buf.get_u8();
7789 *v = val;
7790 }
7791 Ok(__struct)
7792 }
7793 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7794 let mut __tmp = BytesMut::new(bytes);
7795 #[allow(clippy::absurd_extreme_comparisons)]
7796 #[allow(unused_comparisons)]
7797 if __tmp.remaining() < Self::ENCODED_LEN {
7798 panic!(
7799 "buffer is too small (need {} bytes, but got {})",
7800 Self::ENCODED_LEN,
7801 __tmp.remaining(),
7802 )
7803 }
7804 __tmp.put_u32_le(self.id);
7805 __tmp.put_u8(self.target_system);
7806 __tmp.put_u8(self.target_component);
7807 __tmp.put_u8(self.bus);
7808 __tmp.put_u8(self.len);
7809 for val in &self.data {
7810 __tmp.put_u8(*val);
7811 }
7812 if matches!(version, MavlinkVersion::V2) {
7813 let len = __tmp.len();
7814 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7815 } else {
7816 __tmp.len()
7817 }
7818 }
7819}
7820#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
7821#[doc = ""]
7822#[doc = "ID: 388"]
7823#[derive(Debug, Clone, PartialEq)]
7824#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7825#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7826pub struct CAN_FILTER_MODIFY_DATA {
7827 #[doc = "filter IDs, length num_ids"]
7828 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7829 pub ids: [u16; 16],
7830 #[doc = "System ID."]
7831 pub target_system: u8,
7832 #[doc = "Component ID."]
7833 pub target_component: u8,
7834 #[doc = "bus number"]
7835 pub bus: u8,
7836 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
7837 pub operation: CanFilterOp,
7838 #[doc = "number of IDs in filter list"]
7839 pub num_ids: u8,
7840}
7841impl CAN_FILTER_MODIFY_DATA {
7842 pub const ENCODED_LEN: usize = 37usize;
7843 pub const DEFAULT: Self = Self {
7844 ids: [0_u16; 16usize],
7845 target_system: 0_u8,
7846 target_component: 0_u8,
7847 bus: 0_u8,
7848 operation: CanFilterOp::DEFAULT,
7849 num_ids: 0_u8,
7850 };
7851 #[cfg(feature = "arbitrary")]
7852 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7853 use arbitrary::{Arbitrary, Unstructured};
7854 let mut buf = [0u8; 1024];
7855 rng.fill_bytes(&mut buf);
7856 let mut unstructured = Unstructured::new(&buf);
7857 Self::arbitrary(&mut unstructured).unwrap_or_default()
7858 }
7859}
7860impl Default for CAN_FILTER_MODIFY_DATA {
7861 fn default() -> Self {
7862 Self::DEFAULT.clone()
7863 }
7864}
7865impl MessageData for CAN_FILTER_MODIFY_DATA {
7866 type Message = MavMessage;
7867 const ID: u32 = 388u32;
7868 const NAME: &'static str = "CAN_FILTER_MODIFY";
7869 const EXTRA_CRC: u8 = 8u8;
7870 const ENCODED_LEN: usize = 37usize;
7871 fn deser(
7872 _version: MavlinkVersion,
7873 __input: &[u8],
7874 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7875 let avail_len = __input.len();
7876 let mut payload_buf = [0; Self::ENCODED_LEN];
7877 let mut buf = if avail_len < Self::ENCODED_LEN {
7878 payload_buf[0..avail_len].copy_from_slice(__input);
7879 Bytes::new(&payload_buf)
7880 } else {
7881 Bytes::new(__input)
7882 };
7883 let mut __struct = Self::default();
7884 for v in &mut __struct.ids {
7885 let val = buf.get_u16_le();
7886 *v = val;
7887 }
7888 __struct.target_system = buf.get_u8();
7889 __struct.target_component = buf.get_u8();
7890 __struct.bus = buf.get_u8();
7891 let tmp = buf.get_u8();
7892 __struct.operation =
7893 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7894 enum_type: "CanFilterOp",
7895 value: tmp as u32,
7896 })?;
7897 __struct.num_ids = buf.get_u8();
7898 Ok(__struct)
7899 }
7900 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7901 let mut __tmp = BytesMut::new(bytes);
7902 #[allow(clippy::absurd_extreme_comparisons)]
7903 #[allow(unused_comparisons)]
7904 if __tmp.remaining() < Self::ENCODED_LEN {
7905 panic!(
7906 "buffer is too small (need {} bytes, but got {})",
7907 Self::ENCODED_LEN,
7908 __tmp.remaining(),
7909 )
7910 }
7911 for val in &self.ids {
7912 __tmp.put_u16_le(*val);
7913 }
7914 __tmp.put_u8(self.target_system);
7915 __tmp.put_u8(self.target_component);
7916 __tmp.put_u8(self.bus);
7917 __tmp.put_u8(self.operation as u8);
7918 __tmp.put_u8(self.num_ids);
7919 if matches!(version, MavlinkVersion::V2) {
7920 let len = __tmp.len();
7921 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7922 } else {
7923 __tmp.len()
7924 }
7925 }
7926}
7927#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
7928#[doc = ""]
7929#[doc = "ID: 386"]
7930#[derive(Debug, Clone, PartialEq)]
7931#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7933pub struct CAN_FRAME_DATA {
7934 #[doc = "Frame ID"]
7935 pub id: u32,
7936 #[doc = "System ID."]
7937 pub target_system: u8,
7938 #[doc = "Component ID."]
7939 pub target_component: u8,
7940 #[doc = "Bus number"]
7941 pub bus: u8,
7942 #[doc = "Frame length"]
7943 pub len: u8,
7944 #[doc = "Frame data"]
7945 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7946 pub data: [u8; 8],
7947}
7948impl CAN_FRAME_DATA {
7949 pub const ENCODED_LEN: usize = 16usize;
7950 pub const DEFAULT: Self = Self {
7951 id: 0_u32,
7952 target_system: 0_u8,
7953 target_component: 0_u8,
7954 bus: 0_u8,
7955 len: 0_u8,
7956 data: [0_u8; 8usize],
7957 };
7958 #[cfg(feature = "arbitrary")]
7959 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7960 use arbitrary::{Arbitrary, Unstructured};
7961 let mut buf = [0u8; 1024];
7962 rng.fill_bytes(&mut buf);
7963 let mut unstructured = Unstructured::new(&buf);
7964 Self::arbitrary(&mut unstructured).unwrap_or_default()
7965 }
7966}
7967impl Default for CAN_FRAME_DATA {
7968 fn default() -> Self {
7969 Self::DEFAULT.clone()
7970 }
7971}
7972impl MessageData for CAN_FRAME_DATA {
7973 type Message = MavMessage;
7974 const ID: u32 = 386u32;
7975 const NAME: &'static str = "CAN_FRAME";
7976 const EXTRA_CRC: u8 = 132u8;
7977 const ENCODED_LEN: usize = 16usize;
7978 fn deser(
7979 _version: MavlinkVersion,
7980 __input: &[u8],
7981 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7982 let avail_len = __input.len();
7983 let mut payload_buf = [0; Self::ENCODED_LEN];
7984 let mut buf = if avail_len < Self::ENCODED_LEN {
7985 payload_buf[0..avail_len].copy_from_slice(__input);
7986 Bytes::new(&payload_buf)
7987 } else {
7988 Bytes::new(__input)
7989 };
7990 let mut __struct = Self::default();
7991 __struct.id = buf.get_u32_le();
7992 __struct.target_system = buf.get_u8();
7993 __struct.target_component = buf.get_u8();
7994 __struct.bus = buf.get_u8();
7995 __struct.len = buf.get_u8();
7996 for v in &mut __struct.data {
7997 let val = buf.get_u8();
7998 *v = val;
7999 }
8000 Ok(__struct)
8001 }
8002 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8003 let mut __tmp = BytesMut::new(bytes);
8004 #[allow(clippy::absurd_extreme_comparisons)]
8005 #[allow(unused_comparisons)]
8006 if __tmp.remaining() < Self::ENCODED_LEN {
8007 panic!(
8008 "buffer is too small (need {} bytes, but got {})",
8009 Self::ENCODED_LEN,
8010 __tmp.remaining(),
8011 )
8012 }
8013 __tmp.put_u32_le(self.id);
8014 __tmp.put_u8(self.target_system);
8015 __tmp.put_u8(self.target_component);
8016 __tmp.put_u8(self.bus);
8017 __tmp.put_u8(self.len);
8018 for val in &self.data {
8019 __tmp.put_u8(*val);
8020 }
8021 if matches!(version, MavlinkVersion::V2) {
8022 let len = __tmp.len();
8023 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8024 } else {
8025 __tmp.len()
8026 }
8027 }
8028}
8029#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8030#[doc = ""]
8031#[doc = "ID: 336"]
8032#[derive(Debug, Clone, PartialEq)]
8033#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8035pub struct CELLULAR_CONFIG_DATA {
8036 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8037 pub enable_lte: u8,
8038 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8039 pub enable_pin: u8,
8040 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8041 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8042 pub pin: [u8; 16],
8043 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8044 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8045 pub new_pin: [u8; 16],
8046 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8047 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8048 pub apn: [u8; 32],
8049 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8050 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8051 pub puk: [u8; 16],
8052 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8053 pub roaming: u8,
8054 #[doc = "Message acceptance response (sent back to GS)."]
8055 pub response: CellularConfigResponse,
8056}
8057impl CELLULAR_CONFIG_DATA {
8058 pub const ENCODED_LEN: usize = 84usize;
8059 pub const DEFAULT: Self = Self {
8060 enable_lte: 0_u8,
8061 enable_pin: 0_u8,
8062 pin: [0_u8; 16usize],
8063 new_pin: [0_u8; 16usize],
8064 apn: [0_u8; 32usize],
8065 puk: [0_u8; 16usize],
8066 roaming: 0_u8,
8067 response: CellularConfigResponse::DEFAULT,
8068 };
8069 #[cfg(feature = "arbitrary")]
8070 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8071 use arbitrary::{Arbitrary, Unstructured};
8072 let mut buf = [0u8; 1024];
8073 rng.fill_bytes(&mut buf);
8074 let mut unstructured = Unstructured::new(&buf);
8075 Self::arbitrary(&mut unstructured).unwrap_or_default()
8076 }
8077}
8078impl Default for CELLULAR_CONFIG_DATA {
8079 fn default() -> Self {
8080 Self::DEFAULT.clone()
8081 }
8082}
8083impl MessageData for CELLULAR_CONFIG_DATA {
8084 type Message = MavMessage;
8085 const ID: u32 = 336u32;
8086 const NAME: &'static str = "CELLULAR_CONFIG";
8087 const EXTRA_CRC: u8 = 245u8;
8088 const ENCODED_LEN: usize = 84usize;
8089 fn deser(
8090 _version: MavlinkVersion,
8091 __input: &[u8],
8092 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8093 let avail_len = __input.len();
8094 let mut payload_buf = [0; Self::ENCODED_LEN];
8095 let mut buf = if avail_len < Self::ENCODED_LEN {
8096 payload_buf[0..avail_len].copy_from_slice(__input);
8097 Bytes::new(&payload_buf)
8098 } else {
8099 Bytes::new(__input)
8100 };
8101 let mut __struct = Self::default();
8102 __struct.enable_lte = buf.get_u8();
8103 __struct.enable_pin = buf.get_u8();
8104 for v in &mut __struct.pin {
8105 let val = buf.get_u8();
8106 *v = val;
8107 }
8108 for v in &mut __struct.new_pin {
8109 let val = buf.get_u8();
8110 *v = val;
8111 }
8112 for v in &mut __struct.apn {
8113 let val = buf.get_u8();
8114 *v = val;
8115 }
8116 for v in &mut __struct.puk {
8117 let val = buf.get_u8();
8118 *v = val;
8119 }
8120 __struct.roaming = buf.get_u8();
8121 let tmp = buf.get_u8();
8122 __struct.response =
8123 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8124 enum_type: "CellularConfigResponse",
8125 value: tmp as u32,
8126 })?;
8127 Ok(__struct)
8128 }
8129 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8130 let mut __tmp = BytesMut::new(bytes);
8131 #[allow(clippy::absurd_extreme_comparisons)]
8132 #[allow(unused_comparisons)]
8133 if __tmp.remaining() < Self::ENCODED_LEN {
8134 panic!(
8135 "buffer is too small (need {} bytes, but got {})",
8136 Self::ENCODED_LEN,
8137 __tmp.remaining(),
8138 )
8139 }
8140 __tmp.put_u8(self.enable_lte);
8141 __tmp.put_u8(self.enable_pin);
8142 for val in &self.pin {
8143 __tmp.put_u8(*val);
8144 }
8145 for val in &self.new_pin {
8146 __tmp.put_u8(*val);
8147 }
8148 for val in &self.apn {
8149 __tmp.put_u8(*val);
8150 }
8151 for val in &self.puk {
8152 __tmp.put_u8(*val);
8153 }
8154 __tmp.put_u8(self.roaming);
8155 __tmp.put_u8(self.response as u8);
8156 if matches!(version, MavlinkVersion::V2) {
8157 let len = __tmp.len();
8158 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8159 } else {
8160 __tmp.len()
8161 }
8162 }
8163}
8164#[doc = "Report current used cellular network status."]
8165#[doc = ""]
8166#[doc = "ID: 334"]
8167#[derive(Debug, Clone, PartialEq)]
8168#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8170pub struct CELLULAR_STATUS_DATA {
8171 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8172 pub mcc: u16,
8173 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8174 pub mnc: u16,
8175 #[doc = "Location area code. If unknown, set to 0"]
8176 pub lac: u16,
8177 #[doc = "Cellular modem status"]
8178 pub status: CellularStatusFlag,
8179 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8180 pub failure_reason: CellularNetworkFailedReason,
8181 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8182 pub mavtype: CellularNetworkRadioType,
8183 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8184 pub quality: u8,
8185}
8186impl CELLULAR_STATUS_DATA {
8187 pub const ENCODED_LEN: usize = 10usize;
8188 pub const DEFAULT: Self = Self {
8189 mcc: 0_u16,
8190 mnc: 0_u16,
8191 lac: 0_u16,
8192 status: CellularStatusFlag::DEFAULT,
8193 failure_reason: CellularNetworkFailedReason::DEFAULT,
8194 mavtype: CellularNetworkRadioType::DEFAULT,
8195 quality: 0_u8,
8196 };
8197 #[cfg(feature = "arbitrary")]
8198 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8199 use arbitrary::{Arbitrary, Unstructured};
8200 let mut buf = [0u8; 1024];
8201 rng.fill_bytes(&mut buf);
8202 let mut unstructured = Unstructured::new(&buf);
8203 Self::arbitrary(&mut unstructured).unwrap_or_default()
8204 }
8205}
8206impl Default for CELLULAR_STATUS_DATA {
8207 fn default() -> Self {
8208 Self::DEFAULT.clone()
8209 }
8210}
8211impl MessageData for CELLULAR_STATUS_DATA {
8212 type Message = MavMessage;
8213 const ID: u32 = 334u32;
8214 const NAME: &'static str = "CELLULAR_STATUS";
8215 const EXTRA_CRC: u8 = 72u8;
8216 const ENCODED_LEN: usize = 10usize;
8217 fn deser(
8218 _version: MavlinkVersion,
8219 __input: &[u8],
8220 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8221 let avail_len = __input.len();
8222 let mut payload_buf = [0; Self::ENCODED_LEN];
8223 let mut buf = if avail_len < Self::ENCODED_LEN {
8224 payload_buf[0..avail_len].copy_from_slice(__input);
8225 Bytes::new(&payload_buf)
8226 } else {
8227 Bytes::new(__input)
8228 };
8229 let mut __struct = Self::default();
8230 __struct.mcc = buf.get_u16_le();
8231 __struct.mnc = buf.get_u16_le();
8232 __struct.lac = buf.get_u16_le();
8233 let tmp = buf.get_u8();
8234 __struct.status =
8235 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8236 enum_type: "CellularStatusFlag",
8237 value: tmp as u32,
8238 })?;
8239 let tmp = buf.get_u8();
8240 __struct.failure_reason =
8241 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8242 enum_type: "CellularNetworkFailedReason",
8243 value: tmp as u32,
8244 })?;
8245 let tmp = buf.get_u8();
8246 __struct.mavtype =
8247 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8248 enum_type: "CellularNetworkRadioType",
8249 value: tmp as u32,
8250 })?;
8251 __struct.quality = buf.get_u8();
8252 Ok(__struct)
8253 }
8254 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8255 let mut __tmp = BytesMut::new(bytes);
8256 #[allow(clippy::absurd_extreme_comparisons)]
8257 #[allow(unused_comparisons)]
8258 if __tmp.remaining() < Self::ENCODED_LEN {
8259 panic!(
8260 "buffer is too small (need {} bytes, but got {})",
8261 Self::ENCODED_LEN,
8262 __tmp.remaining(),
8263 )
8264 }
8265 __tmp.put_u16_le(self.mcc);
8266 __tmp.put_u16_le(self.mnc);
8267 __tmp.put_u16_le(self.lac);
8268 __tmp.put_u8(self.status as u8);
8269 __tmp.put_u8(self.failure_reason as u8);
8270 __tmp.put_u8(self.mavtype as u8);
8271 __tmp.put_u8(self.quality);
8272 if matches!(version, MavlinkVersion::V2) {
8273 let len = __tmp.len();
8274 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8275 } else {
8276 __tmp.len()
8277 }
8278 }
8279}
8280#[doc = "Request to control this MAV."]
8281#[doc = ""]
8282#[doc = "ID: 5"]
8283#[derive(Debug, Clone, PartialEq)]
8284#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8285#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8286pub struct CHANGE_OPERATOR_CONTROL_DATA {
8287 #[doc = "System the GCS requests control for"]
8288 pub target_system: u8,
8289 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8290 pub control_request: u8,
8291 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8292 pub version: u8,
8293 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8294 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8295 pub passkey: [u8; 25],
8296}
8297impl CHANGE_OPERATOR_CONTROL_DATA {
8298 pub const ENCODED_LEN: usize = 28usize;
8299 pub const DEFAULT: Self = Self {
8300 target_system: 0_u8,
8301 control_request: 0_u8,
8302 version: 0_u8,
8303 passkey: [0_u8; 25usize],
8304 };
8305 #[cfg(feature = "arbitrary")]
8306 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8307 use arbitrary::{Arbitrary, Unstructured};
8308 let mut buf = [0u8; 1024];
8309 rng.fill_bytes(&mut buf);
8310 let mut unstructured = Unstructured::new(&buf);
8311 Self::arbitrary(&mut unstructured).unwrap_or_default()
8312 }
8313}
8314impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8315 fn default() -> Self {
8316 Self::DEFAULT.clone()
8317 }
8318}
8319impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8320 type Message = MavMessage;
8321 const ID: u32 = 5u32;
8322 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8323 const EXTRA_CRC: u8 = 217u8;
8324 const ENCODED_LEN: usize = 28usize;
8325 fn deser(
8326 _version: MavlinkVersion,
8327 __input: &[u8],
8328 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8329 let avail_len = __input.len();
8330 let mut payload_buf = [0; Self::ENCODED_LEN];
8331 let mut buf = if avail_len < Self::ENCODED_LEN {
8332 payload_buf[0..avail_len].copy_from_slice(__input);
8333 Bytes::new(&payload_buf)
8334 } else {
8335 Bytes::new(__input)
8336 };
8337 let mut __struct = Self::default();
8338 __struct.target_system = buf.get_u8();
8339 __struct.control_request = buf.get_u8();
8340 __struct.version = buf.get_u8();
8341 for v in &mut __struct.passkey {
8342 let val = buf.get_u8();
8343 *v = val;
8344 }
8345 Ok(__struct)
8346 }
8347 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8348 let mut __tmp = BytesMut::new(bytes);
8349 #[allow(clippy::absurd_extreme_comparisons)]
8350 #[allow(unused_comparisons)]
8351 if __tmp.remaining() < Self::ENCODED_LEN {
8352 panic!(
8353 "buffer is too small (need {} bytes, but got {})",
8354 Self::ENCODED_LEN,
8355 __tmp.remaining(),
8356 )
8357 }
8358 __tmp.put_u8(self.target_system);
8359 __tmp.put_u8(self.control_request);
8360 __tmp.put_u8(self.version);
8361 for val in &self.passkey {
8362 __tmp.put_u8(*val);
8363 }
8364 if matches!(version, MavlinkVersion::V2) {
8365 let len = __tmp.len();
8366 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8367 } else {
8368 __tmp.len()
8369 }
8370 }
8371}
8372#[doc = "Accept / deny control of this MAV."]
8373#[doc = ""]
8374#[doc = "ID: 6"]
8375#[derive(Debug, Clone, PartialEq)]
8376#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8377#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8378pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8379 #[doc = "ID of the GCS this message"]
8380 pub gcs_system_id: u8,
8381 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8382 pub control_request: u8,
8383 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8384 pub ack: u8,
8385}
8386impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8387 pub const ENCODED_LEN: usize = 3usize;
8388 pub const DEFAULT: Self = Self {
8389 gcs_system_id: 0_u8,
8390 control_request: 0_u8,
8391 ack: 0_u8,
8392 };
8393 #[cfg(feature = "arbitrary")]
8394 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8395 use arbitrary::{Arbitrary, Unstructured};
8396 let mut buf = [0u8; 1024];
8397 rng.fill_bytes(&mut buf);
8398 let mut unstructured = Unstructured::new(&buf);
8399 Self::arbitrary(&mut unstructured).unwrap_or_default()
8400 }
8401}
8402impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8403 fn default() -> Self {
8404 Self::DEFAULT.clone()
8405 }
8406}
8407impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8408 type Message = MavMessage;
8409 const ID: u32 = 6u32;
8410 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8411 const EXTRA_CRC: u8 = 104u8;
8412 const ENCODED_LEN: usize = 3usize;
8413 fn deser(
8414 _version: MavlinkVersion,
8415 __input: &[u8],
8416 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8417 let avail_len = __input.len();
8418 let mut payload_buf = [0; Self::ENCODED_LEN];
8419 let mut buf = if avail_len < Self::ENCODED_LEN {
8420 payload_buf[0..avail_len].copy_from_slice(__input);
8421 Bytes::new(&payload_buf)
8422 } else {
8423 Bytes::new(__input)
8424 };
8425 let mut __struct = Self::default();
8426 __struct.gcs_system_id = buf.get_u8();
8427 __struct.control_request = buf.get_u8();
8428 __struct.ack = buf.get_u8();
8429 Ok(__struct)
8430 }
8431 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8432 let mut __tmp = BytesMut::new(bytes);
8433 #[allow(clippy::absurd_extreme_comparisons)]
8434 #[allow(unused_comparisons)]
8435 if __tmp.remaining() < Self::ENCODED_LEN {
8436 panic!(
8437 "buffer is too small (need {} bytes, but got {})",
8438 Self::ENCODED_LEN,
8439 __tmp.remaining(),
8440 )
8441 }
8442 __tmp.put_u8(self.gcs_system_id);
8443 __tmp.put_u8(self.control_request);
8444 __tmp.put_u8(self.ack);
8445 if matches!(version, MavlinkVersion::V2) {
8446 let len = __tmp.len();
8447 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8448 } else {
8449 __tmp.len()
8450 }
8451 }
8452}
8453#[doc = "Information about a potential collision."]
8454#[doc = ""]
8455#[doc = "ID: 247"]
8456#[derive(Debug, Clone, PartialEq)]
8457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8458#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8459pub struct COLLISION_DATA {
8460 #[doc = "Unique identifier, domain based on src field"]
8461 pub id: u32,
8462 #[doc = "Estimated time until collision occurs"]
8463 pub time_to_minimum_delta: f32,
8464 #[doc = "Closest vertical distance between vehicle and object"]
8465 pub altitude_minimum_delta: f32,
8466 #[doc = "Closest horizontal distance between vehicle and object"]
8467 pub horizontal_minimum_delta: f32,
8468 #[doc = "Collision data source"]
8469 pub src: MavCollisionSrc,
8470 #[doc = "Action that is being taken to avoid this collision"]
8471 pub action: MavCollisionAction,
8472 #[doc = "How concerned the aircraft is about this collision"]
8473 pub threat_level: MavCollisionThreatLevel,
8474}
8475impl COLLISION_DATA {
8476 pub const ENCODED_LEN: usize = 19usize;
8477 pub const DEFAULT: Self = Self {
8478 id: 0_u32,
8479 time_to_minimum_delta: 0.0_f32,
8480 altitude_minimum_delta: 0.0_f32,
8481 horizontal_minimum_delta: 0.0_f32,
8482 src: MavCollisionSrc::DEFAULT,
8483 action: MavCollisionAction::DEFAULT,
8484 threat_level: MavCollisionThreatLevel::DEFAULT,
8485 };
8486 #[cfg(feature = "arbitrary")]
8487 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8488 use arbitrary::{Arbitrary, Unstructured};
8489 let mut buf = [0u8; 1024];
8490 rng.fill_bytes(&mut buf);
8491 let mut unstructured = Unstructured::new(&buf);
8492 Self::arbitrary(&mut unstructured).unwrap_or_default()
8493 }
8494}
8495impl Default for COLLISION_DATA {
8496 fn default() -> Self {
8497 Self::DEFAULT.clone()
8498 }
8499}
8500impl MessageData for COLLISION_DATA {
8501 type Message = MavMessage;
8502 const ID: u32 = 247u32;
8503 const NAME: &'static str = "COLLISION";
8504 const EXTRA_CRC: u8 = 81u8;
8505 const ENCODED_LEN: usize = 19usize;
8506 fn deser(
8507 _version: MavlinkVersion,
8508 __input: &[u8],
8509 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8510 let avail_len = __input.len();
8511 let mut payload_buf = [0; Self::ENCODED_LEN];
8512 let mut buf = if avail_len < Self::ENCODED_LEN {
8513 payload_buf[0..avail_len].copy_from_slice(__input);
8514 Bytes::new(&payload_buf)
8515 } else {
8516 Bytes::new(__input)
8517 };
8518 let mut __struct = Self::default();
8519 __struct.id = buf.get_u32_le();
8520 __struct.time_to_minimum_delta = buf.get_f32_le();
8521 __struct.altitude_minimum_delta = buf.get_f32_le();
8522 __struct.horizontal_minimum_delta = buf.get_f32_le();
8523 let tmp = buf.get_u8();
8524 __struct.src =
8525 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8526 enum_type: "MavCollisionSrc",
8527 value: tmp as u32,
8528 })?;
8529 let tmp = buf.get_u8();
8530 __struct.action =
8531 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8532 enum_type: "MavCollisionAction",
8533 value: tmp as u32,
8534 })?;
8535 let tmp = buf.get_u8();
8536 __struct.threat_level =
8537 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8538 enum_type: "MavCollisionThreatLevel",
8539 value: tmp as u32,
8540 })?;
8541 Ok(__struct)
8542 }
8543 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8544 let mut __tmp = BytesMut::new(bytes);
8545 #[allow(clippy::absurd_extreme_comparisons)]
8546 #[allow(unused_comparisons)]
8547 if __tmp.remaining() < Self::ENCODED_LEN {
8548 panic!(
8549 "buffer is too small (need {} bytes, but got {})",
8550 Self::ENCODED_LEN,
8551 __tmp.remaining(),
8552 )
8553 }
8554 __tmp.put_u32_le(self.id);
8555 __tmp.put_f32_le(self.time_to_minimum_delta);
8556 __tmp.put_f32_le(self.altitude_minimum_delta);
8557 __tmp.put_f32_le(self.horizontal_minimum_delta);
8558 __tmp.put_u8(self.src as u8);
8559 __tmp.put_u8(self.action as u8);
8560 __tmp.put_u8(self.threat_level as u8);
8561 if matches!(version, MavlinkVersion::V2) {
8562 let len = __tmp.len();
8563 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8564 } else {
8565 __tmp.len()
8566 }
8567 }
8568}
8569#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8570#[doc = ""]
8571#[doc = "ID: 77"]
8572#[derive(Debug, Clone, PartialEq)]
8573#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8574#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8575pub struct COMMAND_ACK_DATA {
8576 #[doc = "Command ID (of acknowledged command)."]
8577 pub command: MavCmd,
8578 #[doc = "Result of command."]
8579 pub result: MavResult,
8580 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
8581 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8582 pub progress: u8,
8583 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
8584 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8585 pub result_param2: i32,
8586 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8587 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8588 pub target_system: u8,
8589 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8590 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8591 pub target_component: u8,
8592}
8593impl COMMAND_ACK_DATA {
8594 pub const ENCODED_LEN: usize = 10usize;
8595 pub const DEFAULT: Self = Self {
8596 command: MavCmd::DEFAULT,
8597 result: MavResult::DEFAULT,
8598 progress: 0_u8,
8599 result_param2: 0_i32,
8600 target_system: 0_u8,
8601 target_component: 0_u8,
8602 };
8603 #[cfg(feature = "arbitrary")]
8604 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8605 use arbitrary::{Arbitrary, Unstructured};
8606 let mut buf = [0u8; 1024];
8607 rng.fill_bytes(&mut buf);
8608 let mut unstructured = Unstructured::new(&buf);
8609 Self::arbitrary(&mut unstructured).unwrap_or_default()
8610 }
8611}
8612impl Default for COMMAND_ACK_DATA {
8613 fn default() -> Self {
8614 Self::DEFAULT.clone()
8615 }
8616}
8617impl MessageData for COMMAND_ACK_DATA {
8618 type Message = MavMessage;
8619 const ID: u32 = 77u32;
8620 const NAME: &'static str = "COMMAND_ACK";
8621 const EXTRA_CRC: u8 = 143u8;
8622 const ENCODED_LEN: usize = 10usize;
8623 fn deser(
8624 _version: MavlinkVersion,
8625 __input: &[u8],
8626 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8627 let avail_len = __input.len();
8628 let mut payload_buf = [0; Self::ENCODED_LEN];
8629 let mut buf = if avail_len < Self::ENCODED_LEN {
8630 payload_buf[0..avail_len].copy_from_slice(__input);
8631 Bytes::new(&payload_buf)
8632 } else {
8633 Bytes::new(__input)
8634 };
8635 let mut __struct = Self::default();
8636 let tmp = buf.get_u16_le();
8637 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8638 ::mavlink_core::error::ParserError::InvalidEnum {
8639 enum_type: "MavCmd",
8640 value: tmp as u32,
8641 },
8642 )?;
8643 let tmp = buf.get_u8();
8644 __struct.result =
8645 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8646 enum_type: "MavResult",
8647 value: tmp as u32,
8648 })?;
8649 __struct.progress = buf.get_u8();
8650 __struct.result_param2 = buf.get_i32_le();
8651 __struct.target_system = buf.get_u8();
8652 __struct.target_component = buf.get_u8();
8653 Ok(__struct)
8654 }
8655 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8656 let mut __tmp = BytesMut::new(bytes);
8657 #[allow(clippy::absurd_extreme_comparisons)]
8658 #[allow(unused_comparisons)]
8659 if __tmp.remaining() < Self::ENCODED_LEN {
8660 panic!(
8661 "buffer is too small (need {} bytes, but got {})",
8662 Self::ENCODED_LEN,
8663 __tmp.remaining(),
8664 )
8665 }
8666 __tmp.put_u16_le(self.command as u16);
8667 __tmp.put_u8(self.result as u8);
8668 if matches!(version, MavlinkVersion::V2) {
8669 __tmp.put_u8(self.progress);
8670 __tmp.put_i32_le(self.result_param2);
8671 __tmp.put_u8(self.target_system);
8672 __tmp.put_u8(self.target_component);
8673 let len = __tmp.len();
8674 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8675 } else {
8676 __tmp.len()
8677 }
8678 }
8679}
8680#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8681#[doc = ""]
8682#[doc = "ID: 80"]
8683#[derive(Debug, Clone, PartialEq)]
8684#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8685#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8686pub struct COMMAND_CANCEL_DATA {
8687 #[doc = "Command ID (of command to cancel)."]
8688 pub command: MavCmd,
8689 #[doc = "System executing long running command. Should not be broadcast (0)."]
8690 pub target_system: u8,
8691 #[doc = "Component executing long running command."]
8692 pub target_component: u8,
8693}
8694impl COMMAND_CANCEL_DATA {
8695 pub const ENCODED_LEN: usize = 4usize;
8696 pub const DEFAULT: Self = Self {
8697 command: MavCmd::DEFAULT,
8698 target_system: 0_u8,
8699 target_component: 0_u8,
8700 };
8701 #[cfg(feature = "arbitrary")]
8702 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8703 use arbitrary::{Arbitrary, Unstructured};
8704 let mut buf = [0u8; 1024];
8705 rng.fill_bytes(&mut buf);
8706 let mut unstructured = Unstructured::new(&buf);
8707 Self::arbitrary(&mut unstructured).unwrap_or_default()
8708 }
8709}
8710impl Default for COMMAND_CANCEL_DATA {
8711 fn default() -> Self {
8712 Self::DEFAULT.clone()
8713 }
8714}
8715impl MessageData for COMMAND_CANCEL_DATA {
8716 type Message = MavMessage;
8717 const ID: u32 = 80u32;
8718 const NAME: &'static str = "COMMAND_CANCEL";
8719 const EXTRA_CRC: u8 = 14u8;
8720 const ENCODED_LEN: usize = 4usize;
8721 fn deser(
8722 _version: MavlinkVersion,
8723 __input: &[u8],
8724 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8725 let avail_len = __input.len();
8726 let mut payload_buf = [0; Self::ENCODED_LEN];
8727 let mut buf = if avail_len < Self::ENCODED_LEN {
8728 payload_buf[0..avail_len].copy_from_slice(__input);
8729 Bytes::new(&payload_buf)
8730 } else {
8731 Bytes::new(__input)
8732 };
8733 let mut __struct = Self::default();
8734 let tmp = buf.get_u16_le();
8735 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8736 ::mavlink_core::error::ParserError::InvalidEnum {
8737 enum_type: "MavCmd",
8738 value: tmp as u32,
8739 },
8740 )?;
8741 __struct.target_system = buf.get_u8();
8742 __struct.target_component = buf.get_u8();
8743 Ok(__struct)
8744 }
8745 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8746 let mut __tmp = BytesMut::new(bytes);
8747 #[allow(clippy::absurd_extreme_comparisons)]
8748 #[allow(unused_comparisons)]
8749 if __tmp.remaining() < Self::ENCODED_LEN {
8750 panic!(
8751 "buffer is too small (need {} bytes, but got {})",
8752 Self::ENCODED_LEN,
8753 __tmp.remaining(),
8754 )
8755 }
8756 __tmp.put_u16_le(self.command as u16);
8757 __tmp.put_u8(self.target_system);
8758 __tmp.put_u8(self.target_component);
8759 if matches!(version, MavlinkVersion::V2) {
8760 let len = __tmp.len();
8761 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8762 } else {
8763 __tmp.len()
8764 }
8765 }
8766}
8767#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8768#[doc = ""]
8769#[doc = "ID: 75"]
8770#[derive(Debug, Clone, PartialEq)]
8771#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8772#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8773pub struct COMMAND_INT_DATA {
8774 #[doc = "PARAM1, see MAV_CMD enum"]
8775 pub param1: f32,
8776 #[doc = "PARAM2, see MAV_CMD enum"]
8777 pub param2: f32,
8778 #[doc = "PARAM3, see MAV_CMD enum"]
8779 pub param3: f32,
8780 #[doc = "PARAM4, see MAV_CMD enum"]
8781 pub param4: f32,
8782 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
8783 pub x: i32,
8784 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
8785 pub y: i32,
8786 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
8787 pub z: f32,
8788 #[doc = "The scheduled action for the mission item."]
8789 pub command: MavCmd,
8790 #[doc = "System ID"]
8791 pub target_system: u8,
8792 #[doc = "Component ID"]
8793 pub target_component: u8,
8794 #[doc = "The coordinate system of the COMMAND."]
8795 pub frame: MavFrame,
8796 #[doc = "Not used."]
8797 pub current: u8,
8798 #[doc = "Not used (set 0)."]
8799 pub autocontinue: u8,
8800}
8801impl COMMAND_INT_DATA {
8802 pub const ENCODED_LEN: usize = 35usize;
8803 pub const DEFAULT: Self = Self {
8804 param1: 0.0_f32,
8805 param2: 0.0_f32,
8806 param3: 0.0_f32,
8807 param4: 0.0_f32,
8808 x: 0_i32,
8809 y: 0_i32,
8810 z: 0.0_f32,
8811 command: MavCmd::DEFAULT,
8812 target_system: 0_u8,
8813 target_component: 0_u8,
8814 frame: MavFrame::DEFAULT,
8815 current: 0_u8,
8816 autocontinue: 0_u8,
8817 };
8818 #[cfg(feature = "arbitrary")]
8819 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8820 use arbitrary::{Arbitrary, Unstructured};
8821 let mut buf = [0u8; 1024];
8822 rng.fill_bytes(&mut buf);
8823 let mut unstructured = Unstructured::new(&buf);
8824 Self::arbitrary(&mut unstructured).unwrap_or_default()
8825 }
8826}
8827impl Default for COMMAND_INT_DATA {
8828 fn default() -> Self {
8829 Self::DEFAULT.clone()
8830 }
8831}
8832impl MessageData for COMMAND_INT_DATA {
8833 type Message = MavMessage;
8834 const ID: u32 = 75u32;
8835 const NAME: &'static str = "COMMAND_INT";
8836 const EXTRA_CRC: u8 = 158u8;
8837 const ENCODED_LEN: usize = 35usize;
8838 fn deser(
8839 _version: MavlinkVersion,
8840 __input: &[u8],
8841 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8842 let avail_len = __input.len();
8843 let mut payload_buf = [0; Self::ENCODED_LEN];
8844 let mut buf = if avail_len < Self::ENCODED_LEN {
8845 payload_buf[0..avail_len].copy_from_slice(__input);
8846 Bytes::new(&payload_buf)
8847 } else {
8848 Bytes::new(__input)
8849 };
8850 let mut __struct = Self::default();
8851 __struct.param1 = buf.get_f32_le();
8852 __struct.param2 = buf.get_f32_le();
8853 __struct.param3 = buf.get_f32_le();
8854 __struct.param4 = buf.get_f32_le();
8855 __struct.x = buf.get_i32_le();
8856 __struct.y = buf.get_i32_le();
8857 __struct.z = buf.get_f32_le();
8858 let tmp = buf.get_u16_le();
8859 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8860 ::mavlink_core::error::ParserError::InvalidEnum {
8861 enum_type: "MavCmd",
8862 value: tmp as u32,
8863 },
8864 )?;
8865 __struct.target_system = buf.get_u8();
8866 __struct.target_component = buf.get_u8();
8867 let tmp = buf.get_u8();
8868 __struct.frame =
8869 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8870 enum_type: "MavFrame",
8871 value: tmp as u32,
8872 })?;
8873 __struct.current = buf.get_u8();
8874 __struct.autocontinue = buf.get_u8();
8875 Ok(__struct)
8876 }
8877 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8878 let mut __tmp = BytesMut::new(bytes);
8879 #[allow(clippy::absurd_extreme_comparisons)]
8880 #[allow(unused_comparisons)]
8881 if __tmp.remaining() < Self::ENCODED_LEN {
8882 panic!(
8883 "buffer is too small (need {} bytes, but got {})",
8884 Self::ENCODED_LEN,
8885 __tmp.remaining(),
8886 )
8887 }
8888 __tmp.put_f32_le(self.param1);
8889 __tmp.put_f32_le(self.param2);
8890 __tmp.put_f32_le(self.param3);
8891 __tmp.put_f32_le(self.param4);
8892 __tmp.put_i32_le(self.x);
8893 __tmp.put_i32_le(self.y);
8894 __tmp.put_f32_le(self.z);
8895 __tmp.put_u16_le(self.command as u16);
8896 __tmp.put_u8(self.target_system);
8897 __tmp.put_u8(self.target_component);
8898 __tmp.put_u8(self.frame as u8);
8899 __tmp.put_u8(self.current);
8900 __tmp.put_u8(self.autocontinue);
8901 if matches!(version, MavlinkVersion::V2) {
8902 let len = __tmp.len();
8903 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8904 } else {
8905 __tmp.len()
8906 }
8907 }
8908}
8909#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8910#[doc = ""]
8911#[doc = "ID: 76"]
8912#[derive(Debug, Clone, PartialEq)]
8913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8915pub struct COMMAND_LONG_DATA {
8916 #[doc = "Parameter 1 (for the specific command)."]
8917 pub param1: f32,
8918 #[doc = "Parameter 2 (for the specific command)."]
8919 pub param2: f32,
8920 #[doc = "Parameter 3 (for the specific command)."]
8921 pub param3: f32,
8922 #[doc = "Parameter 4 (for the specific command)."]
8923 pub param4: f32,
8924 #[doc = "Parameter 5 (for the specific command)."]
8925 pub param5: f32,
8926 #[doc = "Parameter 6 (for the specific command)."]
8927 pub param6: f32,
8928 #[doc = "Parameter 7 (for the specific command)."]
8929 pub param7: f32,
8930 #[doc = "Command ID (of command to send)."]
8931 pub command: MavCmd,
8932 #[doc = "System which should execute the command"]
8933 pub target_system: u8,
8934 #[doc = "Component which should execute the command, 0 for all components"]
8935 pub target_component: u8,
8936 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
8937 pub confirmation: u8,
8938}
8939impl COMMAND_LONG_DATA {
8940 pub const ENCODED_LEN: usize = 33usize;
8941 pub const DEFAULT: Self = Self {
8942 param1: 0.0_f32,
8943 param2: 0.0_f32,
8944 param3: 0.0_f32,
8945 param4: 0.0_f32,
8946 param5: 0.0_f32,
8947 param6: 0.0_f32,
8948 param7: 0.0_f32,
8949 command: MavCmd::DEFAULT,
8950 target_system: 0_u8,
8951 target_component: 0_u8,
8952 confirmation: 0_u8,
8953 };
8954 #[cfg(feature = "arbitrary")]
8955 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8956 use arbitrary::{Arbitrary, Unstructured};
8957 let mut buf = [0u8; 1024];
8958 rng.fill_bytes(&mut buf);
8959 let mut unstructured = Unstructured::new(&buf);
8960 Self::arbitrary(&mut unstructured).unwrap_or_default()
8961 }
8962}
8963impl Default for COMMAND_LONG_DATA {
8964 fn default() -> Self {
8965 Self::DEFAULT.clone()
8966 }
8967}
8968impl MessageData for COMMAND_LONG_DATA {
8969 type Message = MavMessage;
8970 const ID: u32 = 76u32;
8971 const NAME: &'static str = "COMMAND_LONG";
8972 const EXTRA_CRC: u8 = 152u8;
8973 const ENCODED_LEN: usize = 33usize;
8974 fn deser(
8975 _version: MavlinkVersion,
8976 __input: &[u8],
8977 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8978 let avail_len = __input.len();
8979 let mut payload_buf = [0; Self::ENCODED_LEN];
8980 let mut buf = if avail_len < Self::ENCODED_LEN {
8981 payload_buf[0..avail_len].copy_from_slice(__input);
8982 Bytes::new(&payload_buf)
8983 } else {
8984 Bytes::new(__input)
8985 };
8986 let mut __struct = Self::default();
8987 __struct.param1 = buf.get_f32_le();
8988 __struct.param2 = buf.get_f32_le();
8989 __struct.param3 = buf.get_f32_le();
8990 __struct.param4 = buf.get_f32_le();
8991 __struct.param5 = buf.get_f32_le();
8992 __struct.param6 = buf.get_f32_le();
8993 __struct.param7 = buf.get_f32_le();
8994 let tmp = buf.get_u16_le();
8995 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8996 ::mavlink_core::error::ParserError::InvalidEnum {
8997 enum_type: "MavCmd",
8998 value: tmp as u32,
8999 },
9000 )?;
9001 __struct.target_system = buf.get_u8();
9002 __struct.target_component = buf.get_u8();
9003 __struct.confirmation = buf.get_u8();
9004 Ok(__struct)
9005 }
9006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9007 let mut __tmp = BytesMut::new(bytes);
9008 #[allow(clippy::absurd_extreme_comparisons)]
9009 #[allow(unused_comparisons)]
9010 if __tmp.remaining() < Self::ENCODED_LEN {
9011 panic!(
9012 "buffer is too small (need {} bytes, but got {})",
9013 Self::ENCODED_LEN,
9014 __tmp.remaining(),
9015 )
9016 }
9017 __tmp.put_f32_le(self.param1);
9018 __tmp.put_f32_le(self.param2);
9019 __tmp.put_f32_le(self.param3);
9020 __tmp.put_f32_le(self.param4);
9021 __tmp.put_f32_le(self.param5);
9022 __tmp.put_f32_le(self.param6);
9023 __tmp.put_f32_le(self.param7);
9024 __tmp.put_u16_le(self.command as u16);
9025 __tmp.put_u8(self.target_system);
9026 __tmp.put_u8(self.target_component);
9027 __tmp.put_u8(self.confirmation);
9028 if matches!(version, MavlinkVersion::V2) {
9029 let len = __tmp.len();
9030 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9031 } else {
9032 __tmp.len()
9033 }
9034 }
9035}
9036#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9037#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9038#[doc = ""]
9039#[doc = "ID: 395"]
9040#[derive(Debug, Clone, PartialEq)]
9041#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9042#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9043pub struct COMPONENT_INFORMATION_DATA {
9044 #[doc = "Timestamp (time since system boot)."]
9045 pub time_boot_ms: u32,
9046 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9047 pub general_metadata_file_crc: u32,
9048 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9049 pub peripherals_metadata_file_crc: u32,
9050 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9051 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9052 pub general_metadata_uri: [u8; 100],
9053 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9054 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9055 pub peripherals_metadata_uri: [u8; 100],
9056}
9057impl COMPONENT_INFORMATION_DATA {
9058 pub const ENCODED_LEN: usize = 212usize;
9059 pub const DEFAULT: Self = Self {
9060 time_boot_ms: 0_u32,
9061 general_metadata_file_crc: 0_u32,
9062 peripherals_metadata_file_crc: 0_u32,
9063 general_metadata_uri: [0_u8; 100usize],
9064 peripherals_metadata_uri: [0_u8; 100usize],
9065 };
9066 #[cfg(feature = "arbitrary")]
9067 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9068 use arbitrary::{Arbitrary, Unstructured};
9069 let mut buf = [0u8; 1024];
9070 rng.fill_bytes(&mut buf);
9071 let mut unstructured = Unstructured::new(&buf);
9072 Self::arbitrary(&mut unstructured).unwrap_or_default()
9073 }
9074}
9075impl Default for COMPONENT_INFORMATION_DATA {
9076 fn default() -> Self {
9077 Self::DEFAULT.clone()
9078 }
9079}
9080impl MessageData for COMPONENT_INFORMATION_DATA {
9081 type Message = MavMessage;
9082 const ID: u32 = 395u32;
9083 const NAME: &'static str = "COMPONENT_INFORMATION";
9084 const EXTRA_CRC: u8 = 0u8;
9085 const ENCODED_LEN: usize = 212usize;
9086 fn deser(
9087 _version: MavlinkVersion,
9088 __input: &[u8],
9089 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9090 let avail_len = __input.len();
9091 let mut payload_buf = [0; Self::ENCODED_LEN];
9092 let mut buf = if avail_len < Self::ENCODED_LEN {
9093 payload_buf[0..avail_len].copy_from_slice(__input);
9094 Bytes::new(&payload_buf)
9095 } else {
9096 Bytes::new(__input)
9097 };
9098 let mut __struct = Self::default();
9099 __struct.time_boot_ms = buf.get_u32_le();
9100 __struct.general_metadata_file_crc = buf.get_u32_le();
9101 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9102 for v in &mut __struct.general_metadata_uri {
9103 let val = buf.get_u8();
9104 *v = val;
9105 }
9106 for v in &mut __struct.peripherals_metadata_uri {
9107 let val = buf.get_u8();
9108 *v = val;
9109 }
9110 Ok(__struct)
9111 }
9112 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9113 let mut __tmp = BytesMut::new(bytes);
9114 #[allow(clippy::absurd_extreme_comparisons)]
9115 #[allow(unused_comparisons)]
9116 if __tmp.remaining() < Self::ENCODED_LEN {
9117 panic!(
9118 "buffer is too small (need {} bytes, but got {})",
9119 Self::ENCODED_LEN,
9120 __tmp.remaining(),
9121 )
9122 }
9123 __tmp.put_u32_le(self.time_boot_ms);
9124 __tmp.put_u32_le(self.general_metadata_file_crc);
9125 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9126 for val in &self.general_metadata_uri {
9127 __tmp.put_u8(*val);
9128 }
9129 for val in &self.peripherals_metadata_uri {
9130 __tmp.put_u8(*val);
9131 }
9132 if matches!(version, MavlinkVersion::V2) {
9133 let len = __tmp.len();
9134 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9135 } else {
9136 __tmp.len()
9137 }
9138 }
9139}
9140#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9141#[doc = ""]
9142#[doc = "ID: 396"]
9143#[derive(Debug, Clone, PartialEq)]
9144#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9145#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9146pub struct COMPONENT_INFORMATION_BASIC_DATA {
9147 #[doc = "Component capability flags"]
9148 pub capabilities: MavProtocolCapability,
9149 #[doc = "Timestamp (time since system boot)."]
9150 pub time_boot_ms: u32,
9151 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9152 pub time_manufacture_s: u32,
9153 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9154 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9155 pub vendor_name: [u8; 32],
9156 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9157 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9158 pub model_name: [u8; 32],
9159 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9160 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9161 pub software_version: [u8; 24],
9162 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9163 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9164 pub hardware_version: [u8; 24],
9165 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9166 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9167 pub serial_number: [u8; 32],
9168}
9169impl COMPONENT_INFORMATION_BASIC_DATA {
9170 pub const ENCODED_LEN: usize = 160usize;
9171 pub const DEFAULT: Self = Self {
9172 capabilities: MavProtocolCapability::DEFAULT,
9173 time_boot_ms: 0_u32,
9174 time_manufacture_s: 0_u32,
9175 vendor_name: [0_u8; 32usize],
9176 model_name: [0_u8; 32usize],
9177 software_version: [0_u8; 24usize],
9178 hardware_version: [0_u8; 24usize],
9179 serial_number: [0_u8; 32usize],
9180 };
9181 #[cfg(feature = "arbitrary")]
9182 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9183 use arbitrary::{Arbitrary, Unstructured};
9184 let mut buf = [0u8; 1024];
9185 rng.fill_bytes(&mut buf);
9186 let mut unstructured = Unstructured::new(&buf);
9187 Self::arbitrary(&mut unstructured).unwrap_or_default()
9188 }
9189}
9190impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9191 fn default() -> Self {
9192 Self::DEFAULT.clone()
9193 }
9194}
9195impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9196 type Message = MavMessage;
9197 const ID: u32 = 396u32;
9198 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9199 const EXTRA_CRC: u8 = 50u8;
9200 const ENCODED_LEN: usize = 160usize;
9201 fn deser(
9202 _version: MavlinkVersion,
9203 __input: &[u8],
9204 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9205 let avail_len = __input.len();
9206 let mut payload_buf = [0; Self::ENCODED_LEN];
9207 let mut buf = if avail_len < Self::ENCODED_LEN {
9208 payload_buf[0..avail_len].copy_from_slice(__input);
9209 Bytes::new(&payload_buf)
9210 } else {
9211 Bytes::new(__input)
9212 };
9213 let mut __struct = Self::default();
9214 let tmp = buf.get_u64_le();
9215 __struct.capabilities = MavProtocolCapability::from_bits(
9216 tmp & MavProtocolCapability::all().bits(),
9217 )
9218 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9219 flag_type: "MavProtocolCapability",
9220 value: tmp as u32,
9221 })?;
9222 __struct.time_boot_ms = buf.get_u32_le();
9223 __struct.time_manufacture_s = buf.get_u32_le();
9224 for v in &mut __struct.vendor_name {
9225 let val = buf.get_u8();
9226 *v = val;
9227 }
9228 for v in &mut __struct.model_name {
9229 let val = buf.get_u8();
9230 *v = val;
9231 }
9232 for v in &mut __struct.software_version {
9233 let val = buf.get_u8();
9234 *v = val;
9235 }
9236 for v in &mut __struct.hardware_version {
9237 let val = buf.get_u8();
9238 *v = val;
9239 }
9240 for v in &mut __struct.serial_number {
9241 let val = buf.get_u8();
9242 *v = val;
9243 }
9244 Ok(__struct)
9245 }
9246 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9247 let mut __tmp = BytesMut::new(bytes);
9248 #[allow(clippy::absurd_extreme_comparisons)]
9249 #[allow(unused_comparisons)]
9250 if __tmp.remaining() < Self::ENCODED_LEN {
9251 panic!(
9252 "buffer is too small (need {} bytes, but got {})",
9253 Self::ENCODED_LEN,
9254 __tmp.remaining(),
9255 )
9256 }
9257 __tmp.put_u64_le(self.capabilities.bits());
9258 __tmp.put_u32_le(self.time_boot_ms);
9259 __tmp.put_u32_le(self.time_manufacture_s);
9260 for val in &self.vendor_name {
9261 __tmp.put_u8(*val);
9262 }
9263 for val in &self.model_name {
9264 __tmp.put_u8(*val);
9265 }
9266 for val in &self.software_version {
9267 __tmp.put_u8(*val);
9268 }
9269 for val in &self.hardware_version {
9270 __tmp.put_u8(*val);
9271 }
9272 for val in &self.serial_number {
9273 __tmp.put_u8(*val);
9274 }
9275 if matches!(version, MavlinkVersion::V2) {
9276 let len = __tmp.len();
9277 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9278 } else {
9279 __tmp.len()
9280 }
9281 }
9282}
9283#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9284#[doc = ""]
9285#[doc = "ID: 397"]
9286#[derive(Debug, Clone, PartialEq)]
9287#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9288#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9289pub struct COMPONENT_METADATA_DATA {
9290 #[doc = "Timestamp (time since system boot)."]
9291 pub time_boot_ms: u32,
9292 #[doc = "CRC32 of the general metadata file."]
9293 pub file_crc: u32,
9294 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9295 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9296 pub uri: [u8; 100],
9297}
9298impl COMPONENT_METADATA_DATA {
9299 pub const ENCODED_LEN: usize = 108usize;
9300 pub const DEFAULT: Self = Self {
9301 time_boot_ms: 0_u32,
9302 file_crc: 0_u32,
9303 uri: [0_u8; 100usize],
9304 };
9305 #[cfg(feature = "arbitrary")]
9306 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9307 use arbitrary::{Arbitrary, Unstructured};
9308 let mut buf = [0u8; 1024];
9309 rng.fill_bytes(&mut buf);
9310 let mut unstructured = Unstructured::new(&buf);
9311 Self::arbitrary(&mut unstructured).unwrap_or_default()
9312 }
9313}
9314impl Default for COMPONENT_METADATA_DATA {
9315 fn default() -> Self {
9316 Self::DEFAULT.clone()
9317 }
9318}
9319impl MessageData for COMPONENT_METADATA_DATA {
9320 type Message = MavMessage;
9321 const ID: u32 = 397u32;
9322 const NAME: &'static str = "COMPONENT_METADATA";
9323 const EXTRA_CRC: u8 = 182u8;
9324 const ENCODED_LEN: usize = 108usize;
9325 fn deser(
9326 _version: MavlinkVersion,
9327 __input: &[u8],
9328 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9329 let avail_len = __input.len();
9330 let mut payload_buf = [0; Self::ENCODED_LEN];
9331 let mut buf = if avail_len < Self::ENCODED_LEN {
9332 payload_buf[0..avail_len].copy_from_slice(__input);
9333 Bytes::new(&payload_buf)
9334 } else {
9335 Bytes::new(__input)
9336 };
9337 let mut __struct = Self::default();
9338 __struct.time_boot_ms = buf.get_u32_le();
9339 __struct.file_crc = buf.get_u32_le();
9340 for v in &mut __struct.uri {
9341 let val = buf.get_u8();
9342 *v = val;
9343 }
9344 Ok(__struct)
9345 }
9346 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9347 let mut __tmp = BytesMut::new(bytes);
9348 #[allow(clippy::absurd_extreme_comparisons)]
9349 #[allow(unused_comparisons)]
9350 if __tmp.remaining() < Self::ENCODED_LEN {
9351 panic!(
9352 "buffer is too small (need {} bytes, but got {})",
9353 Self::ENCODED_LEN,
9354 __tmp.remaining(),
9355 )
9356 }
9357 __tmp.put_u32_le(self.time_boot_ms);
9358 __tmp.put_u32_le(self.file_crc);
9359 for val in &self.uri {
9360 __tmp.put_u8(*val);
9361 }
9362 if matches!(version, MavlinkVersion::V2) {
9363 let len = __tmp.len();
9364 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9365 } else {
9366 __tmp.len()
9367 }
9368 }
9369}
9370#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9371#[doc = ""]
9372#[doc = "ID: 146"]
9373#[derive(Debug, Clone, PartialEq)]
9374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9375#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9376pub struct CONTROL_SYSTEM_STATE_DATA {
9377 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9378 pub time_usec: u64,
9379 #[doc = "X acceleration in body frame"]
9380 pub x_acc: f32,
9381 #[doc = "Y acceleration in body frame"]
9382 pub y_acc: f32,
9383 #[doc = "Z acceleration in body frame"]
9384 pub z_acc: f32,
9385 #[doc = "X velocity in body frame"]
9386 pub x_vel: f32,
9387 #[doc = "Y velocity in body frame"]
9388 pub y_vel: f32,
9389 #[doc = "Z velocity in body frame"]
9390 pub z_vel: f32,
9391 #[doc = "X position in local frame"]
9392 pub x_pos: f32,
9393 #[doc = "Y position in local frame"]
9394 pub y_pos: f32,
9395 #[doc = "Z position in local frame"]
9396 pub z_pos: f32,
9397 #[doc = "Airspeed, set to -1 if unknown"]
9398 pub airspeed: f32,
9399 #[doc = "Variance of body velocity estimate"]
9400 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9401 pub vel_variance: [f32; 3],
9402 #[doc = "Variance in local position"]
9403 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9404 pub pos_variance: [f32; 3],
9405 #[doc = "The attitude, represented as Quaternion"]
9406 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9407 pub q: [f32; 4],
9408 #[doc = "Angular rate in roll axis"]
9409 pub roll_rate: f32,
9410 #[doc = "Angular rate in pitch axis"]
9411 pub pitch_rate: f32,
9412 #[doc = "Angular rate in yaw axis"]
9413 pub yaw_rate: f32,
9414}
9415impl CONTROL_SYSTEM_STATE_DATA {
9416 pub const ENCODED_LEN: usize = 100usize;
9417 pub const DEFAULT: Self = Self {
9418 time_usec: 0_u64,
9419 x_acc: 0.0_f32,
9420 y_acc: 0.0_f32,
9421 z_acc: 0.0_f32,
9422 x_vel: 0.0_f32,
9423 y_vel: 0.0_f32,
9424 z_vel: 0.0_f32,
9425 x_pos: 0.0_f32,
9426 y_pos: 0.0_f32,
9427 z_pos: 0.0_f32,
9428 airspeed: 0.0_f32,
9429 vel_variance: [0.0_f32; 3usize],
9430 pos_variance: [0.0_f32; 3usize],
9431 q: [0.0_f32; 4usize],
9432 roll_rate: 0.0_f32,
9433 pitch_rate: 0.0_f32,
9434 yaw_rate: 0.0_f32,
9435 };
9436 #[cfg(feature = "arbitrary")]
9437 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9438 use arbitrary::{Arbitrary, Unstructured};
9439 let mut buf = [0u8; 1024];
9440 rng.fill_bytes(&mut buf);
9441 let mut unstructured = Unstructured::new(&buf);
9442 Self::arbitrary(&mut unstructured).unwrap_or_default()
9443 }
9444}
9445impl Default for CONTROL_SYSTEM_STATE_DATA {
9446 fn default() -> Self {
9447 Self::DEFAULT.clone()
9448 }
9449}
9450impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9451 type Message = MavMessage;
9452 const ID: u32 = 146u32;
9453 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9454 const EXTRA_CRC: u8 = 103u8;
9455 const ENCODED_LEN: usize = 100usize;
9456 fn deser(
9457 _version: MavlinkVersion,
9458 __input: &[u8],
9459 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9460 let avail_len = __input.len();
9461 let mut payload_buf = [0; Self::ENCODED_LEN];
9462 let mut buf = if avail_len < Self::ENCODED_LEN {
9463 payload_buf[0..avail_len].copy_from_slice(__input);
9464 Bytes::new(&payload_buf)
9465 } else {
9466 Bytes::new(__input)
9467 };
9468 let mut __struct = Self::default();
9469 __struct.time_usec = buf.get_u64_le();
9470 __struct.x_acc = buf.get_f32_le();
9471 __struct.y_acc = buf.get_f32_le();
9472 __struct.z_acc = buf.get_f32_le();
9473 __struct.x_vel = buf.get_f32_le();
9474 __struct.y_vel = buf.get_f32_le();
9475 __struct.z_vel = buf.get_f32_le();
9476 __struct.x_pos = buf.get_f32_le();
9477 __struct.y_pos = buf.get_f32_le();
9478 __struct.z_pos = buf.get_f32_le();
9479 __struct.airspeed = buf.get_f32_le();
9480 for v in &mut __struct.vel_variance {
9481 let val = buf.get_f32_le();
9482 *v = val;
9483 }
9484 for v in &mut __struct.pos_variance {
9485 let val = buf.get_f32_le();
9486 *v = val;
9487 }
9488 for v in &mut __struct.q {
9489 let val = buf.get_f32_le();
9490 *v = val;
9491 }
9492 __struct.roll_rate = buf.get_f32_le();
9493 __struct.pitch_rate = buf.get_f32_le();
9494 __struct.yaw_rate = buf.get_f32_le();
9495 Ok(__struct)
9496 }
9497 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9498 let mut __tmp = BytesMut::new(bytes);
9499 #[allow(clippy::absurd_extreme_comparisons)]
9500 #[allow(unused_comparisons)]
9501 if __tmp.remaining() < Self::ENCODED_LEN {
9502 panic!(
9503 "buffer is too small (need {} bytes, but got {})",
9504 Self::ENCODED_LEN,
9505 __tmp.remaining(),
9506 )
9507 }
9508 __tmp.put_u64_le(self.time_usec);
9509 __tmp.put_f32_le(self.x_acc);
9510 __tmp.put_f32_le(self.y_acc);
9511 __tmp.put_f32_le(self.z_acc);
9512 __tmp.put_f32_le(self.x_vel);
9513 __tmp.put_f32_le(self.y_vel);
9514 __tmp.put_f32_le(self.z_vel);
9515 __tmp.put_f32_le(self.x_pos);
9516 __tmp.put_f32_le(self.y_pos);
9517 __tmp.put_f32_le(self.z_pos);
9518 __tmp.put_f32_le(self.airspeed);
9519 for val in &self.vel_variance {
9520 __tmp.put_f32_le(*val);
9521 }
9522 for val in &self.pos_variance {
9523 __tmp.put_f32_le(*val);
9524 }
9525 for val in &self.q {
9526 __tmp.put_f32_le(*val);
9527 }
9528 __tmp.put_f32_le(self.roll_rate);
9529 __tmp.put_f32_le(self.pitch_rate);
9530 __tmp.put_f32_le(self.yaw_rate);
9531 if matches!(version, MavlinkVersion::V2) {
9532 let len = __tmp.len();
9533 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9534 } else {
9535 __tmp.len()
9536 }
9537 }
9538}
9539#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
9540#[doc = ""]
9541#[doc = "ID: 411"]
9542#[derive(Debug, Clone, PartialEq)]
9543#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9544#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9545pub struct CURRENT_EVENT_SEQUENCE_DATA {
9546 #[doc = "Sequence number."]
9547 pub sequence: u16,
9548 #[doc = "Flag bitset."]
9549 pub flags: MavEventCurrentSequenceFlags,
9550}
9551impl CURRENT_EVENT_SEQUENCE_DATA {
9552 pub const ENCODED_LEN: usize = 3usize;
9553 pub const DEFAULT: Self = Self {
9554 sequence: 0_u16,
9555 flags: MavEventCurrentSequenceFlags::DEFAULT,
9556 };
9557 #[cfg(feature = "arbitrary")]
9558 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9559 use arbitrary::{Arbitrary, Unstructured};
9560 let mut buf = [0u8; 1024];
9561 rng.fill_bytes(&mut buf);
9562 let mut unstructured = Unstructured::new(&buf);
9563 Self::arbitrary(&mut unstructured).unwrap_or_default()
9564 }
9565}
9566impl Default for CURRENT_EVENT_SEQUENCE_DATA {
9567 fn default() -> Self {
9568 Self::DEFAULT.clone()
9569 }
9570}
9571impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
9572 type Message = MavMessage;
9573 const ID: u32 = 411u32;
9574 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
9575 const EXTRA_CRC: u8 = 106u8;
9576 const ENCODED_LEN: usize = 3usize;
9577 fn deser(
9578 _version: MavlinkVersion,
9579 __input: &[u8],
9580 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9581 let avail_len = __input.len();
9582 let mut payload_buf = [0; Self::ENCODED_LEN];
9583 let mut buf = if avail_len < Self::ENCODED_LEN {
9584 payload_buf[0..avail_len].copy_from_slice(__input);
9585 Bytes::new(&payload_buf)
9586 } else {
9587 Bytes::new(__input)
9588 };
9589 let mut __struct = Self::default();
9590 __struct.sequence = buf.get_u16_le();
9591 let tmp = buf.get_u8();
9592 __struct.flags =
9593 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9594 enum_type: "MavEventCurrentSequenceFlags",
9595 value: tmp as u32,
9596 })?;
9597 Ok(__struct)
9598 }
9599 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9600 let mut __tmp = BytesMut::new(bytes);
9601 #[allow(clippy::absurd_extreme_comparisons)]
9602 #[allow(unused_comparisons)]
9603 if __tmp.remaining() < Self::ENCODED_LEN {
9604 panic!(
9605 "buffer is too small (need {} bytes, but got {})",
9606 Self::ENCODED_LEN,
9607 __tmp.remaining(),
9608 )
9609 }
9610 __tmp.put_u16_le(self.sequence);
9611 __tmp.put_u8(self.flags as u8);
9612 if matches!(version, MavlinkVersion::V2) {
9613 let len = __tmp.len();
9614 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9615 } else {
9616 __tmp.len()
9617 }
9618 }
9619}
9620#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
9621#[doc = ""]
9622#[doc = "ID: 436"]
9623#[derive(Debug, Clone, PartialEq)]
9624#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9625#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9626pub struct CURRENT_MODE_DATA {
9627 #[doc = "A bitfield for use for autopilot-specific flags"]
9628 pub custom_mode: u32,
9629 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
9630 pub intended_custom_mode: u32,
9631 #[doc = "Standard mode."]
9632 pub standard_mode: MavStandardMode,
9633}
9634impl CURRENT_MODE_DATA {
9635 pub const ENCODED_LEN: usize = 9usize;
9636 pub const DEFAULT: Self = Self {
9637 custom_mode: 0_u32,
9638 intended_custom_mode: 0_u32,
9639 standard_mode: MavStandardMode::DEFAULT,
9640 };
9641 #[cfg(feature = "arbitrary")]
9642 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9643 use arbitrary::{Arbitrary, Unstructured};
9644 let mut buf = [0u8; 1024];
9645 rng.fill_bytes(&mut buf);
9646 let mut unstructured = Unstructured::new(&buf);
9647 Self::arbitrary(&mut unstructured).unwrap_or_default()
9648 }
9649}
9650impl Default for CURRENT_MODE_DATA {
9651 fn default() -> Self {
9652 Self::DEFAULT.clone()
9653 }
9654}
9655impl MessageData for CURRENT_MODE_DATA {
9656 type Message = MavMessage;
9657 const ID: u32 = 436u32;
9658 const NAME: &'static str = "CURRENT_MODE";
9659 const EXTRA_CRC: u8 = 193u8;
9660 const ENCODED_LEN: usize = 9usize;
9661 fn deser(
9662 _version: MavlinkVersion,
9663 __input: &[u8],
9664 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9665 let avail_len = __input.len();
9666 let mut payload_buf = [0; Self::ENCODED_LEN];
9667 let mut buf = if avail_len < Self::ENCODED_LEN {
9668 payload_buf[0..avail_len].copy_from_slice(__input);
9669 Bytes::new(&payload_buf)
9670 } else {
9671 Bytes::new(__input)
9672 };
9673 let mut __struct = Self::default();
9674 __struct.custom_mode = buf.get_u32_le();
9675 __struct.intended_custom_mode = buf.get_u32_le();
9676 let tmp = buf.get_u8();
9677 __struct.standard_mode =
9678 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9679 enum_type: "MavStandardMode",
9680 value: tmp as u32,
9681 })?;
9682 Ok(__struct)
9683 }
9684 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9685 let mut __tmp = BytesMut::new(bytes);
9686 #[allow(clippy::absurd_extreme_comparisons)]
9687 #[allow(unused_comparisons)]
9688 if __tmp.remaining() < Self::ENCODED_LEN {
9689 panic!(
9690 "buffer is too small (need {} bytes, but got {})",
9691 Self::ENCODED_LEN,
9692 __tmp.remaining(),
9693 )
9694 }
9695 __tmp.put_u32_le(self.custom_mode);
9696 __tmp.put_u32_le(self.intended_custom_mode);
9697 __tmp.put_u8(self.standard_mode as u8);
9698 if matches!(version, MavlinkVersion::V2) {
9699 let len = __tmp.len();
9700 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9701 } else {
9702 __tmp.len()
9703 }
9704 }
9705}
9706#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
9707#[doc = "Data stream status information."]
9708#[doc = ""]
9709#[doc = "ID: 67"]
9710#[derive(Debug, Clone, PartialEq)]
9711#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9713pub struct DATA_STREAM_DATA {
9714 #[doc = "The message rate"]
9715 pub message_rate: u16,
9716 #[doc = "The ID of the requested data stream"]
9717 pub stream_id: u8,
9718 #[doc = "1 stream is enabled, 0 stream is stopped."]
9719 pub on_off: u8,
9720}
9721impl DATA_STREAM_DATA {
9722 pub const ENCODED_LEN: usize = 4usize;
9723 pub const DEFAULT: Self = Self {
9724 message_rate: 0_u16,
9725 stream_id: 0_u8,
9726 on_off: 0_u8,
9727 };
9728 #[cfg(feature = "arbitrary")]
9729 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9730 use arbitrary::{Arbitrary, Unstructured};
9731 let mut buf = [0u8; 1024];
9732 rng.fill_bytes(&mut buf);
9733 let mut unstructured = Unstructured::new(&buf);
9734 Self::arbitrary(&mut unstructured).unwrap_or_default()
9735 }
9736}
9737impl Default for DATA_STREAM_DATA {
9738 fn default() -> Self {
9739 Self::DEFAULT.clone()
9740 }
9741}
9742impl MessageData for DATA_STREAM_DATA {
9743 type Message = MavMessage;
9744 const ID: u32 = 67u32;
9745 const NAME: &'static str = "DATA_STREAM";
9746 const EXTRA_CRC: u8 = 21u8;
9747 const ENCODED_LEN: usize = 4usize;
9748 fn deser(
9749 _version: MavlinkVersion,
9750 __input: &[u8],
9751 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9752 let avail_len = __input.len();
9753 let mut payload_buf = [0; Self::ENCODED_LEN];
9754 let mut buf = if avail_len < Self::ENCODED_LEN {
9755 payload_buf[0..avail_len].copy_from_slice(__input);
9756 Bytes::new(&payload_buf)
9757 } else {
9758 Bytes::new(__input)
9759 };
9760 let mut __struct = Self::default();
9761 __struct.message_rate = buf.get_u16_le();
9762 __struct.stream_id = buf.get_u8();
9763 __struct.on_off = buf.get_u8();
9764 Ok(__struct)
9765 }
9766 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9767 let mut __tmp = BytesMut::new(bytes);
9768 #[allow(clippy::absurd_extreme_comparisons)]
9769 #[allow(unused_comparisons)]
9770 if __tmp.remaining() < Self::ENCODED_LEN {
9771 panic!(
9772 "buffer is too small (need {} bytes, but got {})",
9773 Self::ENCODED_LEN,
9774 __tmp.remaining(),
9775 )
9776 }
9777 __tmp.put_u16_le(self.message_rate);
9778 __tmp.put_u8(self.stream_id);
9779 __tmp.put_u8(self.on_off);
9780 if matches!(version, MavlinkVersion::V2) {
9781 let len = __tmp.len();
9782 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9783 } else {
9784 __tmp.len()
9785 }
9786 }
9787}
9788#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
9789#[doc = ""]
9790#[doc = "ID: 130"]
9791#[derive(Debug, Clone, PartialEq)]
9792#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9793#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9794pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
9795 #[doc = "total data size (set on ACK only)."]
9796 pub size: u32,
9797 #[doc = "Width of a matrix or image."]
9798 pub width: u16,
9799 #[doc = "Height of a matrix or image."]
9800 pub height: u16,
9801 #[doc = "Number of packets being sent (set on ACK only)."]
9802 pub packets: u16,
9803 #[doc = "Type of requested/acknowledged data."]
9804 pub mavtype: MavlinkDataStreamType,
9805 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
9806 pub payload: u8,
9807 #[doc = "JPEG quality. Values: [1-100]."]
9808 pub jpg_quality: u8,
9809}
9810impl DATA_TRANSMISSION_HANDSHAKE_DATA {
9811 pub const ENCODED_LEN: usize = 13usize;
9812 pub const DEFAULT: Self = Self {
9813 size: 0_u32,
9814 width: 0_u16,
9815 height: 0_u16,
9816 packets: 0_u16,
9817 mavtype: MavlinkDataStreamType::DEFAULT,
9818 payload: 0_u8,
9819 jpg_quality: 0_u8,
9820 };
9821 #[cfg(feature = "arbitrary")]
9822 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9823 use arbitrary::{Arbitrary, Unstructured};
9824 let mut buf = [0u8; 1024];
9825 rng.fill_bytes(&mut buf);
9826 let mut unstructured = Unstructured::new(&buf);
9827 Self::arbitrary(&mut unstructured).unwrap_or_default()
9828 }
9829}
9830impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
9831 fn default() -> Self {
9832 Self::DEFAULT.clone()
9833 }
9834}
9835impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
9836 type Message = MavMessage;
9837 const ID: u32 = 130u32;
9838 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
9839 const EXTRA_CRC: u8 = 29u8;
9840 const ENCODED_LEN: usize = 13usize;
9841 fn deser(
9842 _version: MavlinkVersion,
9843 __input: &[u8],
9844 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9845 let avail_len = __input.len();
9846 let mut payload_buf = [0; Self::ENCODED_LEN];
9847 let mut buf = if avail_len < Self::ENCODED_LEN {
9848 payload_buf[0..avail_len].copy_from_slice(__input);
9849 Bytes::new(&payload_buf)
9850 } else {
9851 Bytes::new(__input)
9852 };
9853 let mut __struct = Self::default();
9854 __struct.size = buf.get_u32_le();
9855 __struct.width = buf.get_u16_le();
9856 __struct.height = buf.get_u16_le();
9857 __struct.packets = buf.get_u16_le();
9858 let tmp = buf.get_u8();
9859 __struct.mavtype =
9860 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9861 enum_type: "MavlinkDataStreamType",
9862 value: tmp as u32,
9863 })?;
9864 __struct.payload = buf.get_u8();
9865 __struct.jpg_quality = buf.get_u8();
9866 Ok(__struct)
9867 }
9868 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9869 let mut __tmp = BytesMut::new(bytes);
9870 #[allow(clippy::absurd_extreme_comparisons)]
9871 #[allow(unused_comparisons)]
9872 if __tmp.remaining() < Self::ENCODED_LEN {
9873 panic!(
9874 "buffer is too small (need {} bytes, but got {})",
9875 Self::ENCODED_LEN,
9876 __tmp.remaining(),
9877 )
9878 }
9879 __tmp.put_u32_le(self.size);
9880 __tmp.put_u16_le(self.width);
9881 __tmp.put_u16_le(self.height);
9882 __tmp.put_u16_le(self.packets);
9883 __tmp.put_u8(self.mavtype as u8);
9884 __tmp.put_u8(self.payload);
9885 __tmp.put_u8(self.jpg_quality);
9886 if matches!(version, MavlinkVersion::V2) {
9887 let len = __tmp.len();
9888 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9889 } else {
9890 __tmp.len()
9891 }
9892 }
9893}
9894#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
9895#[doc = ""]
9896#[doc = "ID: 254"]
9897#[derive(Debug, Clone, PartialEq)]
9898#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9899#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9900pub struct DEBUG_DATA {
9901 #[doc = "Timestamp (time since system boot)."]
9902 pub time_boot_ms: u32,
9903 #[doc = "DEBUG value"]
9904 pub value: f32,
9905 #[doc = "index of debug variable"]
9906 pub ind: u8,
9907}
9908impl DEBUG_DATA {
9909 pub const ENCODED_LEN: usize = 9usize;
9910 pub const DEFAULT: Self = Self {
9911 time_boot_ms: 0_u32,
9912 value: 0.0_f32,
9913 ind: 0_u8,
9914 };
9915 #[cfg(feature = "arbitrary")]
9916 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9917 use arbitrary::{Arbitrary, Unstructured};
9918 let mut buf = [0u8; 1024];
9919 rng.fill_bytes(&mut buf);
9920 let mut unstructured = Unstructured::new(&buf);
9921 Self::arbitrary(&mut unstructured).unwrap_or_default()
9922 }
9923}
9924impl Default for DEBUG_DATA {
9925 fn default() -> Self {
9926 Self::DEFAULT.clone()
9927 }
9928}
9929impl MessageData for DEBUG_DATA {
9930 type Message = MavMessage;
9931 const ID: u32 = 254u32;
9932 const NAME: &'static str = "DEBUG";
9933 const EXTRA_CRC: u8 = 46u8;
9934 const ENCODED_LEN: usize = 9usize;
9935 fn deser(
9936 _version: MavlinkVersion,
9937 __input: &[u8],
9938 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9939 let avail_len = __input.len();
9940 let mut payload_buf = [0; Self::ENCODED_LEN];
9941 let mut buf = if avail_len < Self::ENCODED_LEN {
9942 payload_buf[0..avail_len].copy_from_slice(__input);
9943 Bytes::new(&payload_buf)
9944 } else {
9945 Bytes::new(__input)
9946 };
9947 let mut __struct = Self::default();
9948 __struct.time_boot_ms = buf.get_u32_le();
9949 __struct.value = buf.get_f32_le();
9950 __struct.ind = buf.get_u8();
9951 Ok(__struct)
9952 }
9953 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9954 let mut __tmp = BytesMut::new(bytes);
9955 #[allow(clippy::absurd_extreme_comparisons)]
9956 #[allow(unused_comparisons)]
9957 if __tmp.remaining() < Self::ENCODED_LEN {
9958 panic!(
9959 "buffer is too small (need {} bytes, but got {})",
9960 Self::ENCODED_LEN,
9961 __tmp.remaining(),
9962 )
9963 }
9964 __tmp.put_u32_le(self.time_boot_ms);
9965 __tmp.put_f32_le(self.value);
9966 __tmp.put_u8(self.ind);
9967 if matches!(version, MavlinkVersion::V2) {
9968 let len = __tmp.len();
9969 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9970 } else {
9971 __tmp.len()
9972 }
9973 }
9974}
9975#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
9976#[doc = ""]
9977#[doc = "ID: 350"]
9978#[derive(Debug, Clone, PartialEq)]
9979#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9980#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9981pub struct DEBUG_FLOAT_ARRAY_DATA {
9982 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9983 pub time_usec: u64,
9984 #[doc = "Unique ID used to discriminate between arrays"]
9985 pub array_id: u16,
9986 #[doc = "Name, for human-friendly display in a Ground Control Station"]
9987 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9988 pub name: [u8; 10],
9989 #[doc = "data"]
9990 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9991 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9992 pub data: [f32; 58],
9993}
9994impl DEBUG_FLOAT_ARRAY_DATA {
9995 pub const ENCODED_LEN: usize = 252usize;
9996 pub const DEFAULT: Self = Self {
9997 time_usec: 0_u64,
9998 array_id: 0_u16,
9999 name: [0_u8; 10usize],
10000 data: [0.0_f32; 58usize],
10001 };
10002 #[cfg(feature = "arbitrary")]
10003 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10004 use arbitrary::{Arbitrary, Unstructured};
10005 let mut buf = [0u8; 1024];
10006 rng.fill_bytes(&mut buf);
10007 let mut unstructured = Unstructured::new(&buf);
10008 Self::arbitrary(&mut unstructured).unwrap_or_default()
10009 }
10010}
10011impl Default for DEBUG_FLOAT_ARRAY_DATA {
10012 fn default() -> Self {
10013 Self::DEFAULT.clone()
10014 }
10015}
10016impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10017 type Message = MavMessage;
10018 const ID: u32 = 350u32;
10019 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10020 const EXTRA_CRC: u8 = 232u8;
10021 const ENCODED_LEN: usize = 252usize;
10022 fn deser(
10023 _version: MavlinkVersion,
10024 __input: &[u8],
10025 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10026 let avail_len = __input.len();
10027 let mut payload_buf = [0; Self::ENCODED_LEN];
10028 let mut buf = if avail_len < Self::ENCODED_LEN {
10029 payload_buf[0..avail_len].copy_from_slice(__input);
10030 Bytes::new(&payload_buf)
10031 } else {
10032 Bytes::new(__input)
10033 };
10034 let mut __struct = Self::default();
10035 __struct.time_usec = buf.get_u64_le();
10036 __struct.array_id = buf.get_u16_le();
10037 for v in &mut __struct.name {
10038 let val = buf.get_u8();
10039 *v = val;
10040 }
10041 for v in &mut __struct.data {
10042 let val = buf.get_f32_le();
10043 *v = val;
10044 }
10045 Ok(__struct)
10046 }
10047 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10048 let mut __tmp = BytesMut::new(bytes);
10049 #[allow(clippy::absurd_extreme_comparisons)]
10050 #[allow(unused_comparisons)]
10051 if __tmp.remaining() < Self::ENCODED_LEN {
10052 panic!(
10053 "buffer is too small (need {} bytes, but got {})",
10054 Self::ENCODED_LEN,
10055 __tmp.remaining(),
10056 )
10057 }
10058 __tmp.put_u64_le(self.time_usec);
10059 __tmp.put_u16_le(self.array_id);
10060 for val in &self.name {
10061 __tmp.put_u8(*val);
10062 }
10063 if matches!(version, MavlinkVersion::V2) {
10064 for val in &self.data {
10065 __tmp.put_f32_le(*val);
10066 }
10067 let len = __tmp.len();
10068 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10069 } else {
10070 __tmp.len()
10071 }
10072 }
10073}
10074#[doc = "To debug something using a named 3D vector."]
10075#[doc = ""]
10076#[doc = "ID: 250"]
10077#[derive(Debug, Clone, PartialEq)]
10078#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10080pub struct DEBUG_VECT_DATA {
10081 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10082 pub time_usec: u64,
10083 #[doc = "x"]
10084 pub x: f32,
10085 #[doc = "y"]
10086 pub y: f32,
10087 #[doc = "z"]
10088 pub z: f32,
10089 #[doc = "Name"]
10090 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10091 pub name: [u8; 10],
10092}
10093impl DEBUG_VECT_DATA {
10094 pub const ENCODED_LEN: usize = 30usize;
10095 pub const DEFAULT: Self = Self {
10096 time_usec: 0_u64,
10097 x: 0.0_f32,
10098 y: 0.0_f32,
10099 z: 0.0_f32,
10100 name: [0_u8; 10usize],
10101 };
10102 #[cfg(feature = "arbitrary")]
10103 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10104 use arbitrary::{Arbitrary, Unstructured};
10105 let mut buf = [0u8; 1024];
10106 rng.fill_bytes(&mut buf);
10107 let mut unstructured = Unstructured::new(&buf);
10108 Self::arbitrary(&mut unstructured).unwrap_or_default()
10109 }
10110}
10111impl Default for DEBUG_VECT_DATA {
10112 fn default() -> Self {
10113 Self::DEFAULT.clone()
10114 }
10115}
10116impl MessageData for DEBUG_VECT_DATA {
10117 type Message = MavMessage;
10118 const ID: u32 = 250u32;
10119 const NAME: &'static str = "DEBUG_VECT";
10120 const EXTRA_CRC: u8 = 49u8;
10121 const ENCODED_LEN: usize = 30usize;
10122 fn deser(
10123 _version: MavlinkVersion,
10124 __input: &[u8],
10125 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10126 let avail_len = __input.len();
10127 let mut payload_buf = [0; Self::ENCODED_LEN];
10128 let mut buf = if avail_len < Self::ENCODED_LEN {
10129 payload_buf[0..avail_len].copy_from_slice(__input);
10130 Bytes::new(&payload_buf)
10131 } else {
10132 Bytes::new(__input)
10133 };
10134 let mut __struct = Self::default();
10135 __struct.time_usec = buf.get_u64_le();
10136 __struct.x = buf.get_f32_le();
10137 __struct.y = buf.get_f32_le();
10138 __struct.z = buf.get_f32_le();
10139 for v in &mut __struct.name {
10140 let val = buf.get_u8();
10141 *v = val;
10142 }
10143 Ok(__struct)
10144 }
10145 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10146 let mut __tmp = BytesMut::new(bytes);
10147 #[allow(clippy::absurd_extreme_comparisons)]
10148 #[allow(unused_comparisons)]
10149 if __tmp.remaining() < Self::ENCODED_LEN {
10150 panic!(
10151 "buffer is too small (need {} bytes, but got {})",
10152 Self::ENCODED_LEN,
10153 __tmp.remaining(),
10154 )
10155 }
10156 __tmp.put_u64_le(self.time_usec);
10157 __tmp.put_f32_le(self.x);
10158 __tmp.put_f32_le(self.y);
10159 __tmp.put_f32_le(self.z);
10160 for val in &self.name {
10161 __tmp.put_u8(*val);
10162 }
10163 if matches!(version, MavlinkVersion::V2) {
10164 let len = __tmp.len();
10165 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10166 } else {
10167 __tmp.len()
10168 }
10169 }
10170}
10171#[doc = "Distance sensor information for an onboard rangefinder."]
10172#[doc = ""]
10173#[doc = "ID: 132"]
10174#[derive(Debug, Clone, PartialEq)]
10175#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10177pub struct DISTANCE_SENSOR_DATA {
10178 #[doc = "Timestamp (time since system boot)."]
10179 pub time_boot_ms: u32,
10180 #[doc = "Minimum distance the sensor can measure"]
10181 pub min_distance: u16,
10182 #[doc = "Maximum distance the sensor can measure"]
10183 pub max_distance: u16,
10184 #[doc = "Current distance reading"]
10185 pub current_distance: u16,
10186 #[doc = "Type of distance sensor."]
10187 pub mavtype: MavDistanceSensor,
10188 #[doc = "Onboard ID of the sensor"]
10189 pub id: u8,
10190 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10191 pub orientation: MavSensorOrientation,
10192 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10193 pub covariance: u8,
10194 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10195 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10196 pub horizontal_fov: f32,
10197 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10198 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10199 pub vertical_fov: f32,
10200 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10201 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10202 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10203 pub quaternion: [f32; 4],
10204 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10205 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10206 pub signal_quality: u8,
10207}
10208impl DISTANCE_SENSOR_DATA {
10209 pub const ENCODED_LEN: usize = 39usize;
10210 pub const DEFAULT: Self = Self {
10211 time_boot_ms: 0_u32,
10212 min_distance: 0_u16,
10213 max_distance: 0_u16,
10214 current_distance: 0_u16,
10215 mavtype: MavDistanceSensor::DEFAULT,
10216 id: 0_u8,
10217 orientation: MavSensorOrientation::DEFAULT,
10218 covariance: 0_u8,
10219 horizontal_fov: 0.0_f32,
10220 vertical_fov: 0.0_f32,
10221 quaternion: [0.0_f32; 4usize],
10222 signal_quality: 0_u8,
10223 };
10224 #[cfg(feature = "arbitrary")]
10225 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10226 use arbitrary::{Arbitrary, Unstructured};
10227 let mut buf = [0u8; 1024];
10228 rng.fill_bytes(&mut buf);
10229 let mut unstructured = Unstructured::new(&buf);
10230 Self::arbitrary(&mut unstructured).unwrap_or_default()
10231 }
10232}
10233impl Default for DISTANCE_SENSOR_DATA {
10234 fn default() -> Self {
10235 Self::DEFAULT.clone()
10236 }
10237}
10238impl MessageData for DISTANCE_SENSOR_DATA {
10239 type Message = MavMessage;
10240 const ID: u32 = 132u32;
10241 const NAME: &'static str = "DISTANCE_SENSOR";
10242 const EXTRA_CRC: u8 = 85u8;
10243 const ENCODED_LEN: usize = 39usize;
10244 fn deser(
10245 _version: MavlinkVersion,
10246 __input: &[u8],
10247 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10248 let avail_len = __input.len();
10249 let mut payload_buf = [0; Self::ENCODED_LEN];
10250 let mut buf = if avail_len < Self::ENCODED_LEN {
10251 payload_buf[0..avail_len].copy_from_slice(__input);
10252 Bytes::new(&payload_buf)
10253 } else {
10254 Bytes::new(__input)
10255 };
10256 let mut __struct = Self::default();
10257 __struct.time_boot_ms = buf.get_u32_le();
10258 __struct.min_distance = buf.get_u16_le();
10259 __struct.max_distance = buf.get_u16_le();
10260 __struct.current_distance = buf.get_u16_le();
10261 let tmp = buf.get_u8();
10262 __struct.mavtype =
10263 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10264 enum_type: "MavDistanceSensor",
10265 value: tmp as u32,
10266 })?;
10267 __struct.id = buf.get_u8();
10268 let tmp = buf.get_u8();
10269 __struct.orientation =
10270 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10271 enum_type: "MavSensorOrientation",
10272 value: tmp as u32,
10273 })?;
10274 __struct.covariance = buf.get_u8();
10275 __struct.horizontal_fov = buf.get_f32_le();
10276 __struct.vertical_fov = buf.get_f32_le();
10277 for v in &mut __struct.quaternion {
10278 let val = buf.get_f32_le();
10279 *v = val;
10280 }
10281 __struct.signal_quality = buf.get_u8();
10282 Ok(__struct)
10283 }
10284 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10285 let mut __tmp = BytesMut::new(bytes);
10286 #[allow(clippy::absurd_extreme_comparisons)]
10287 #[allow(unused_comparisons)]
10288 if __tmp.remaining() < Self::ENCODED_LEN {
10289 panic!(
10290 "buffer is too small (need {} bytes, but got {})",
10291 Self::ENCODED_LEN,
10292 __tmp.remaining(),
10293 )
10294 }
10295 __tmp.put_u32_le(self.time_boot_ms);
10296 __tmp.put_u16_le(self.min_distance);
10297 __tmp.put_u16_le(self.max_distance);
10298 __tmp.put_u16_le(self.current_distance);
10299 __tmp.put_u8(self.mavtype as u8);
10300 __tmp.put_u8(self.id);
10301 __tmp.put_u8(self.orientation as u8);
10302 __tmp.put_u8(self.covariance);
10303 if matches!(version, MavlinkVersion::V2) {
10304 __tmp.put_f32_le(self.horizontal_fov);
10305 __tmp.put_f32_le(self.vertical_fov);
10306 for val in &self.quaternion {
10307 __tmp.put_f32_le(*val);
10308 }
10309 __tmp.put_u8(self.signal_quality);
10310 let len = __tmp.len();
10311 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10312 } else {
10313 __tmp.len()
10314 }
10315 }
10316}
10317#[doc = "EFI status output."]
10318#[doc = ""]
10319#[doc = "ID: 225"]
10320#[derive(Debug, Clone, PartialEq)]
10321#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10322#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10323pub struct EFI_STATUS_DATA {
10324 #[doc = "ECU index"]
10325 pub ecu_index: f32,
10326 #[doc = "RPM"]
10327 pub rpm: f32,
10328 #[doc = "Fuel consumed"]
10329 pub fuel_consumed: f32,
10330 #[doc = "Fuel flow rate"]
10331 pub fuel_flow: f32,
10332 #[doc = "Engine load"]
10333 pub engine_load: f32,
10334 #[doc = "Throttle position"]
10335 pub throttle_position: f32,
10336 #[doc = "Spark dwell time"]
10337 pub spark_dwell_time: f32,
10338 #[doc = "Barometric pressure"]
10339 pub barometric_pressure: f32,
10340 #[doc = "Intake manifold pressure("]
10341 pub intake_manifold_pressure: f32,
10342 #[doc = "Intake manifold temperature"]
10343 pub intake_manifold_temperature: f32,
10344 #[doc = "Cylinder head temperature"]
10345 pub cylinder_head_temperature: f32,
10346 #[doc = "Ignition timing (Crank angle degrees)"]
10347 pub ignition_timing: f32,
10348 #[doc = "Injection time"]
10349 pub injection_time: f32,
10350 #[doc = "Exhaust gas temperature"]
10351 pub exhaust_gas_temperature: f32,
10352 #[doc = "Output throttle"]
10353 pub throttle_out: f32,
10354 #[doc = "Pressure/temperature compensation"]
10355 pub pt_compensation: f32,
10356 #[doc = "EFI health status"]
10357 pub health: u8,
10358 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10359 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10360 pub ignition_voltage: f32,
10361 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10362 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10363 pub fuel_pressure: f32,
10364}
10365impl EFI_STATUS_DATA {
10366 pub const ENCODED_LEN: usize = 73usize;
10367 pub const DEFAULT: Self = Self {
10368 ecu_index: 0.0_f32,
10369 rpm: 0.0_f32,
10370 fuel_consumed: 0.0_f32,
10371 fuel_flow: 0.0_f32,
10372 engine_load: 0.0_f32,
10373 throttle_position: 0.0_f32,
10374 spark_dwell_time: 0.0_f32,
10375 barometric_pressure: 0.0_f32,
10376 intake_manifold_pressure: 0.0_f32,
10377 intake_manifold_temperature: 0.0_f32,
10378 cylinder_head_temperature: 0.0_f32,
10379 ignition_timing: 0.0_f32,
10380 injection_time: 0.0_f32,
10381 exhaust_gas_temperature: 0.0_f32,
10382 throttle_out: 0.0_f32,
10383 pt_compensation: 0.0_f32,
10384 health: 0_u8,
10385 ignition_voltage: 0.0_f32,
10386 fuel_pressure: 0.0_f32,
10387 };
10388 #[cfg(feature = "arbitrary")]
10389 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10390 use arbitrary::{Arbitrary, Unstructured};
10391 let mut buf = [0u8; 1024];
10392 rng.fill_bytes(&mut buf);
10393 let mut unstructured = Unstructured::new(&buf);
10394 Self::arbitrary(&mut unstructured).unwrap_or_default()
10395 }
10396}
10397impl Default for EFI_STATUS_DATA {
10398 fn default() -> Self {
10399 Self::DEFAULT.clone()
10400 }
10401}
10402impl MessageData for EFI_STATUS_DATA {
10403 type Message = MavMessage;
10404 const ID: u32 = 225u32;
10405 const NAME: &'static str = "EFI_STATUS";
10406 const EXTRA_CRC: u8 = 208u8;
10407 const ENCODED_LEN: usize = 73usize;
10408 fn deser(
10409 _version: MavlinkVersion,
10410 __input: &[u8],
10411 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10412 let avail_len = __input.len();
10413 let mut payload_buf = [0; Self::ENCODED_LEN];
10414 let mut buf = if avail_len < Self::ENCODED_LEN {
10415 payload_buf[0..avail_len].copy_from_slice(__input);
10416 Bytes::new(&payload_buf)
10417 } else {
10418 Bytes::new(__input)
10419 };
10420 let mut __struct = Self::default();
10421 __struct.ecu_index = buf.get_f32_le();
10422 __struct.rpm = buf.get_f32_le();
10423 __struct.fuel_consumed = buf.get_f32_le();
10424 __struct.fuel_flow = buf.get_f32_le();
10425 __struct.engine_load = buf.get_f32_le();
10426 __struct.throttle_position = buf.get_f32_le();
10427 __struct.spark_dwell_time = buf.get_f32_le();
10428 __struct.barometric_pressure = buf.get_f32_le();
10429 __struct.intake_manifold_pressure = buf.get_f32_le();
10430 __struct.intake_manifold_temperature = buf.get_f32_le();
10431 __struct.cylinder_head_temperature = buf.get_f32_le();
10432 __struct.ignition_timing = buf.get_f32_le();
10433 __struct.injection_time = buf.get_f32_le();
10434 __struct.exhaust_gas_temperature = buf.get_f32_le();
10435 __struct.throttle_out = buf.get_f32_le();
10436 __struct.pt_compensation = buf.get_f32_le();
10437 __struct.health = buf.get_u8();
10438 __struct.ignition_voltage = buf.get_f32_le();
10439 __struct.fuel_pressure = buf.get_f32_le();
10440 Ok(__struct)
10441 }
10442 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10443 let mut __tmp = BytesMut::new(bytes);
10444 #[allow(clippy::absurd_extreme_comparisons)]
10445 #[allow(unused_comparisons)]
10446 if __tmp.remaining() < Self::ENCODED_LEN {
10447 panic!(
10448 "buffer is too small (need {} bytes, but got {})",
10449 Self::ENCODED_LEN,
10450 __tmp.remaining(),
10451 )
10452 }
10453 __tmp.put_f32_le(self.ecu_index);
10454 __tmp.put_f32_le(self.rpm);
10455 __tmp.put_f32_le(self.fuel_consumed);
10456 __tmp.put_f32_le(self.fuel_flow);
10457 __tmp.put_f32_le(self.engine_load);
10458 __tmp.put_f32_le(self.throttle_position);
10459 __tmp.put_f32_le(self.spark_dwell_time);
10460 __tmp.put_f32_le(self.barometric_pressure);
10461 __tmp.put_f32_le(self.intake_manifold_pressure);
10462 __tmp.put_f32_le(self.intake_manifold_temperature);
10463 __tmp.put_f32_le(self.cylinder_head_temperature);
10464 __tmp.put_f32_le(self.ignition_timing);
10465 __tmp.put_f32_le(self.injection_time);
10466 __tmp.put_f32_le(self.exhaust_gas_temperature);
10467 __tmp.put_f32_le(self.throttle_out);
10468 __tmp.put_f32_le(self.pt_compensation);
10469 __tmp.put_u8(self.health);
10470 if matches!(version, MavlinkVersion::V2) {
10471 __tmp.put_f32_le(self.ignition_voltage);
10472 __tmp.put_f32_le(self.fuel_pressure);
10473 let len = __tmp.len();
10474 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10475 } else {
10476 __tmp.len()
10477 }
10478 }
10479}
10480#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10481#[doc = ""]
10482#[doc = "ID: 131"]
10483#[derive(Debug, Clone, PartialEq)]
10484#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10485#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10486pub struct ENCAPSULATED_DATA_DATA {
10487 #[doc = "sequence number (starting with 0 on every transmission)"]
10488 pub seqnr: u16,
10489 #[doc = "image data bytes"]
10490 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10491 pub data: [u8; 253],
10492}
10493impl ENCAPSULATED_DATA_DATA {
10494 pub const ENCODED_LEN: usize = 255usize;
10495 pub const DEFAULT: Self = Self {
10496 seqnr: 0_u16,
10497 data: [0_u8; 253usize],
10498 };
10499 #[cfg(feature = "arbitrary")]
10500 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10501 use arbitrary::{Arbitrary, Unstructured};
10502 let mut buf = [0u8; 1024];
10503 rng.fill_bytes(&mut buf);
10504 let mut unstructured = Unstructured::new(&buf);
10505 Self::arbitrary(&mut unstructured).unwrap_or_default()
10506 }
10507}
10508impl Default for ENCAPSULATED_DATA_DATA {
10509 fn default() -> Self {
10510 Self::DEFAULT.clone()
10511 }
10512}
10513impl MessageData for ENCAPSULATED_DATA_DATA {
10514 type Message = MavMessage;
10515 const ID: u32 = 131u32;
10516 const NAME: &'static str = "ENCAPSULATED_DATA";
10517 const EXTRA_CRC: u8 = 223u8;
10518 const ENCODED_LEN: usize = 255usize;
10519 fn deser(
10520 _version: MavlinkVersion,
10521 __input: &[u8],
10522 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10523 let avail_len = __input.len();
10524 let mut payload_buf = [0; Self::ENCODED_LEN];
10525 let mut buf = if avail_len < Self::ENCODED_LEN {
10526 payload_buf[0..avail_len].copy_from_slice(__input);
10527 Bytes::new(&payload_buf)
10528 } else {
10529 Bytes::new(__input)
10530 };
10531 let mut __struct = Self::default();
10532 __struct.seqnr = buf.get_u16_le();
10533 for v in &mut __struct.data {
10534 let val = buf.get_u8();
10535 *v = val;
10536 }
10537 Ok(__struct)
10538 }
10539 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10540 let mut __tmp = BytesMut::new(bytes);
10541 #[allow(clippy::absurd_extreme_comparisons)]
10542 #[allow(unused_comparisons)]
10543 if __tmp.remaining() < Self::ENCODED_LEN {
10544 panic!(
10545 "buffer is too small (need {} bytes, but got {})",
10546 Self::ENCODED_LEN,
10547 __tmp.remaining(),
10548 )
10549 }
10550 __tmp.put_u16_le(self.seqnr);
10551 for val in &self.data {
10552 __tmp.put_u8(*val);
10553 }
10554 if matches!(version, MavlinkVersion::V2) {
10555 let len = __tmp.len();
10556 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10557 } else {
10558 __tmp.len()
10559 }
10560 }
10561}
10562#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
10563#[doc = ""]
10564#[doc = "ID: 290"]
10565#[derive(Debug, Clone, PartialEq)]
10566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10568pub struct ESC_INFO_DATA {
10569 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10570 pub time_usec: u64,
10571 #[doc = "Number of reported errors by each ESC since boot."]
10572 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10573 pub error_count: [u32; 4],
10574 #[doc = "Counter of data packets received."]
10575 pub counter: u16,
10576 #[doc = "Bitmap of ESC failure flags."]
10577 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10578 pub failure_flags: [u16; 4],
10579 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
10580 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10581 pub temperature: [i16; 4],
10582 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
10583 pub index: u8,
10584 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
10585 pub count: u8,
10586 #[doc = "Connection type protocol for all ESC."]
10587 pub connection_type: EscConnectionType,
10588 #[doc = "Information regarding online/offline status of each ESC."]
10589 pub info: u8,
10590}
10591impl ESC_INFO_DATA {
10592 pub const ENCODED_LEN: usize = 46usize;
10593 pub const DEFAULT: Self = Self {
10594 time_usec: 0_u64,
10595 error_count: [0_u32; 4usize],
10596 counter: 0_u16,
10597 failure_flags: [0_u16; 4usize],
10598 temperature: [0_i16; 4usize],
10599 index: 0_u8,
10600 count: 0_u8,
10601 connection_type: EscConnectionType::DEFAULT,
10602 info: 0_u8,
10603 };
10604 #[cfg(feature = "arbitrary")]
10605 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10606 use arbitrary::{Arbitrary, Unstructured};
10607 let mut buf = [0u8; 1024];
10608 rng.fill_bytes(&mut buf);
10609 let mut unstructured = Unstructured::new(&buf);
10610 Self::arbitrary(&mut unstructured).unwrap_or_default()
10611 }
10612}
10613impl Default for ESC_INFO_DATA {
10614 fn default() -> Self {
10615 Self::DEFAULT.clone()
10616 }
10617}
10618impl MessageData for ESC_INFO_DATA {
10619 type Message = MavMessage;
10620 const ID: u32 = 290u32;
10621 const NAME: &'static str = "ESC_INFO";
10622 const EXTRA_CRC: u8 = 251u8;
10623 const ENCODED_LEN: usize = 46usize;
10624 fn deser(
10625 _version: MavlinkVersion,
10626 __input: &[u8],
10627 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10628 let avail_len = __input.len();
10629 let mut payload_buf = [0; Self::ENCODED_LEN];
10630 let mut buf = if avail_len < Self::ENCODED_LEN {
10631 payload_buf[0..avail_len].copy_from_slice(__input);
10632 Bytes::new(&payload_buf)
10633 } else {
10634 Bytes::new(__input)
10635 };
10636 let mut __struct = Self::default();
10637 __struct.time_usec = buf.get_u64_le();
10638 for v in &mut __struct.error_count {
10639 let val = buf.get_u32_le();
10640 *v = val;
10641 }
10642 __struct.counter = buf.get_u16_le();
10643 for v in &mut __struct.failure_flags {
10644 let val = buf.get_u16_le();
10645 *v = val;
10646 }
10647 for v in &mut __struct.temperature {
10648 let val = buf.get_i16_le();
10649 *v = val;
10650 }
10651 __struct.index = buf.get_u8();
10652 __struct.count = buf.get_u8();
10653 let tmp = buf.get_u8();
10654 __struct.connection_type =
10655 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10656 enum_type: "EscConnectionType",
10657 value: tmp as u32,
10658 })?;
10659 __struct.info = buf.get_u8();
10660 Ok(__struct)
10661 }
10662 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10663 let mut __tmp = BytesMut::new(bytes);
10664 #[allow(clippy::absurd_extreme_comparisons)]
10665 #[allow(unused_comparisons)]
10666 if __tmp.remaining() < Self::ENCODED_LEN {
10667 panic!(
10668 "buffer is too small (need {} bytes, but got {})",
10669 Self::ENCODED_LEN,
10670 __tmp.remaining(),
10671 )
10672 }
10673 __tmp.put_u64_le(self.time_usec);
10674 for val in &self.error_count {
10675 __tmp.put_u32_le(*val);
10676 }
10677 __tmp.put_u16_le(self.counter);
10678 for val in &self.failure_flags {
10679 __tmp.put_u16_le(*val);
10680 }
10681 for val in &self.temperature {
10682 __tmp.put_i16_le(*val);
10683 }
10684 __tmp.put_u8(self.index);
10685 __tmp.put_u8(self.count);
10686 __tmp.put_u8(self.connection_type as u8);
10687 __tmp.put_u8(self.info);
10688 if matches!(version, MavlinkVersion::V2) {
10689 let len = __tmp.len();
10690 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10691 } else {
10692 __tmp.len()
10693 }
10694 }
10695}
10696#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
10697#[doc = ""]
10698#[doc = "ID: 291"]
10699#[derive(Debug, Clone, PartialEq)]
10700#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10701#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10702pub struct ESC_STATUS_DATA {
10703 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10704 pub time_usec: u64,
10705 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
10706 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10707 pub rpm: [i32; 4],
10708 #[doc = "Voltage measured from each ESC."]
10709 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10710 pub voltage: [f32; 4],
10711 #[doc = "Current measured from each ESC."]
10712 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10713 pub current: [f32; 4],
10714 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
10715 pub index: u8,
10716}
10717impl ESC_STATUS_DATA {
10718 pub const ENCODED_LEN: usize = 57usize;
10719 pub const DEFAULT: Self = Self {
10720 time_usec: 0_u64,
10721 rpm: [0_i32; 4usize],
10722 voltage: [0.0_f32; 4usize],
10723 current: [0.0_f32; 4usize],
10724 index: 0_u8,
10725 };
10726 #[cfg(feature = "arbitrary")]
10727 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10728 use arbitrary::{Arbitrary, Unstructured};
10729 let mut buf = [0u8; 1024];
10730 rng.fill_bytes(&mut buf);
10731 let mut unstructured = Unstructured::new(&buf);
10732 Self::arbitrary(&mut unstructured).unwrap_or_default()
10733 }
10734}
10735impl Default for ESC_STATUS_DATA {
10736 fn default() -> Self {
10737 Self::DEFAULT.clone()
10738 }
10739}
10740impl MessageData for ESC_STATUS_DATA {
10741 type Message = MavMessage;
10742 const ID: u32 = 291u32;
10743 const NAME: &'static str = "ESC_STATUS";
10744 const EXTRA_CRC: u8 = 10u8;
10745 const ENCODED_LEN: usize = 57usize;
10746 fn deser(
10747 _version: MavlinkVersion,
10748 __input: &[u8],
10749 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10750 let avail_len = __input.len();
10751 let mut payload_buf = [0; Self::ENCODED_LEN];
10752 let mut buf = if avail_len < Self::ENCODED_LEN {
10753 payload_buf[0..avail_len].copy_from_slice(__input);
10754 Bytes::new(&payload_buf)
10755 } else {
10756 Bytes::new(__input)
10757 };
10758 let mut __struct = Self::default();
10759 __struct.time_usec = buf.get_u64_le();
10760 for v in &mut __struct.rpm {
10761 let val = buf.get_i32_le();
10762 *v = val;
10763 }
10764 for v in &mut __struct.voltage {
10765 let val = buf.get_f32_le();
10766 *v = val;
10767 }
10768 for v in &mut __struct.current {
10769 let val = buf.get_f32_le();
10770 *v = val;
10771 }
10772 __struct.index = buf.get_u8();
10773 Ok(__struct)
10774 }
10775 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10776 let mut __tmp = BytesMut::new(bytes);
10777 #[allow(clippy::absurd_extreme_comparisons)]
10778 #[allow(unused_comparisons)]
10779 if __tmp.remaining() < Self::ENCODED_LEN {
10780 panic!(
10781 "buffer is too small (need {} bytes, but got {})",
10782 Self::ENCODED_LEN,
10783 __tmp.remaining(),
10784 )
10785 }
10786 __tmp.put_u64_le(self.time_usec);
10787 for val in &self.rpm {
10788 __tmp.put_i32_le(*val);
10789 }
10790 for val in &self.voltage {
10791 __tmp.put_f32_le(*val);
10792 }
10793 for val in &self.current {
10794 __tmp.put_f32_le(*val);
10795 }
10796 __tmp.put_u8(self.index);
10797 if matches!(version, MavlinkVersion::V2) {
10798 let len = __tmp.len();
10799 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10800 } else {
10801 __tmp.len()
10802 }
10803 }
10804}
10805#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
10806#[doc = ""]
10807#[doc = "ID: 230"]
10808#[derive(Debug, Clone, PartialEq)]
10809#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10810#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10811pub struct ESTIMATOR_STATUS_DATA {
10812 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10813 pub time_usec: u64,
10814 #[doc = "Velocity innovation test ratio"]
10815 pub vel_ratio: f32,
10816 #[doc = "Horizontal position innovation test ratio"]
10817 pub pos_horiz_ratio: f32,
10818 #[doc = "Vertical position innovation test ratio"]
10819 pub pos_vert_ratio: f32,
10820 #[doc = "Magnetometer innovation test ratio"]
10821 pub mag_ratio: f32,
10822 #[doc = "Height above terrain innovation test ratio"]
10823 pub hagl_ratio: f32,
10824 #[doc = "True airspeed innovation test ratio"]
10825 pub tas_ratio: f32,
10826 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
10827 pub pos_horiz_accuracy: f32,
10828 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
10829 pub pos_vert_accuracy: f32,
10830 #[doc = "Bitmap indicating which EKF outputs are valid."]
10831 pub flags: EstimatorStatusFlags,
10832}
10833impl ESTIMATOR_STATUS_DATA {
10834 pub const ENCODED_LEN: usize = 42usize;
10835 pub const DEFAULT: Self = Self {
10836 time_usec: 0_u64,
10837 vel_ratio: 0.0_f32,
10838 pos_horiz_ratio: 0.0_f32,
10839 pos_vert_ratio: 0.0_f32,
10840 mag_ratio: 0.0_f32,
10841 hagl_ratio: 0.0_f32,
10842 tas_ratio: 0.0_f32,
10843 pos_horiz_accuracy: 0.0_f32,
10844 pos_vert_accuracy: 0.0_f32,
10845 flags: EstimatorStatusFlags::DEFAULT,
10846 };
10847 #[cfg(feature = "arbitrary")]
10848 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10849 use arbitrary::{Arbitrary, Unstructured};
10850 let mut buf = [0u8; 1024];
10851 rng.fill_bytes(&mut buf);
10852 let mut unstructured = Unstructured::new(&buf);
10853 Self::arbitrary(&mut unstructured).unwrap_or_default()
10854 }
10855}
10856impl Default for ESTIMATOR_STATUS_DATA {
10857 fn default() -> Self {
10858 Self::DEFAULT.clone()
10859 }
10860}
10861impl MessageData for ESTIMATOR_STATUS_DATA {
10862 type Message = MavMessage;
10863 const ID: u32 = 230u32;
10864 const NAME: &'static str = "ESTIMATOR_STATUS";
10865 const EXTRA_CRC: u8 = 163u8;
10866 const ENCODED_LEN: usize = 42usize;
10867 fn deser(
10868 _version: MavlinkVersion,
10869 __input: &[u8],
10870 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10871 let avail_len = __input.len();
10872 let mut payload_buf = [0; Self::ENCODED_LEN];
10873 let mut buf = if avail_len < Self::ENCODED_LEN {
10874 payload_buf[0..avail_len].copy_from_slice(__input);
10875 Bytes::new(&payload_buf)
10876 } else {
10877 Bytes::new(__input)
10878 };
10879 let mut __struct = Self::default();
10880 __struct.time_usec = buf.get_u64_le();
10881 __struct.vel_ratio = buf.get_f32_le();
10882 __struct.pos_horiz_ratio = buf.get_f32_le();
10883 __struct.pos_vert_ratio = buf.get_f32_le();
10884 __struct.mag_ratio = buf.get_f32_le();
10885 __struct.hagl_ratio = buf.get_f32_le();
10886 __struct.tas_ratio = buf.get_f32_le();
10887 __struct.pos_horiz_accuracy = buf.get_f32_le();
10888 __struct.pos_vert_accuracy = buf.get_f32_le();
10889 let tmp = buf.get_u16_le();
10890 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
10891 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
10892 flag_type: "EstimatorStatusFlags",
10893 value: tmp as u32,
10894 })?;
10895 Ok(__struct)
10896 }
10897 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10898 let mut __tmp = BytesMut::new(bytes);
10899 #[allow(clippy::absurd_extreme_comparisons)]
10900 #[allow(unused_comparisons)]
10901 if __tmp.remaining() < Self::ENCODED_LEN {
10902 panic!(
10903 "buffer is too small (need {} bytes, but got {})",
10904 Self::ENCODED_LEN,
10905 __tmp.remaining(),
10906 )
10907 }
10908 __tmp.put_u64_le(self.time_usec);
10909 __tmp.put_f32_le(self.vel_ratio);
10910 __tmp.put_f32_le(self.pos_horiz_ratio);
10911 __tmp.put_f32_le(self.pos_vert_ratio);
10912 __tmp.put_f32_le(self.mag_ratio);
10913 __tmp.put_f32_le(self.hagl_ratio);
10914 __tmp.put_f32_le(self.tas_ratio);
10915 __tmp.put_f32_le(self.pos_horiz_accuracy);
10916 __tmp.put_f32_le(self.pos_vert_accuracy);
10917 __tmp.put_u16_le(self.flags.bits());
10918 if matches!(version, MavlinkVersion::V2) {
10919 let len = __tmp.len();
10920 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10921 } else {
10922 __tmp.len()
10923 }
10924 }
10925}
10926#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
10927#[doc = ""]
10928#[doc = "ID: 410"]
10929#[derive(Debug, Clone, PartialEq)]
10930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10932pub struct EVENT_DATA {
10933 #[doc = "Event ID (as defined in the component metadata)"]
10934 pub id: u32,
10935 #[doc = "Timestamp (time since system boot when the event happened)."]
10936 pub event_time_boot_ms: u32,
10937 #[doc = "Sequence number."]
10938 pub sequence: u16,
10939 #[doc = "Component ID"]
10940 pub destination_component: u8,
10941 #[doc = "System ID"]
10942 pub destination_system: u8,
10943 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
10944 pub log_levels: u8,
10945 #[doc = "Arguments (depend on event ID)."]
10946 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10947 pub arguments: [u8; 40],
10948}
10949impl EVENT_DATA {
10950 pub const ENCODED_LEN: usize = 53usize;
10951 pub const DEFAULT: Self = Self {
10952 id: 0_u32,
10953 event_time_boot_ms: 0_u32,
10954 sequence: 0_u16,
10955 destination_component: 0_u8,
10956 destination_system: 0_u8,
10957 log_levels: 0_u8,
10958 arguments: [0_u8; 40usize],
10959 };
10960 #[cfg(feature = "arbitrary")]
10961 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10962 use arbitrary::{Arbitrary, Unstructured};
10963 let mut buf = [0u8; 1024];
10964 rng.fill_bytes(&mut buf);
10965 let mut unstructured = Unstructured::new(&buf);
10966 Self::arbitrary(&mut unstructured).unwrap_or_default()
10967 }
10968}
10969impl Default for EVENT_DATA {
10970 fn default() -> Self {
10971 Self::DEFAULT.clone()
10972 }
10973}
10974impl MessageData for EVENT_DATA {
10975 type Message = MavMessage;
10976 const ID: u32 = 410u32;
10977 const NAME: &'static str = "EVENT";
10978 const EXTRA_CRC: u8 = 160u8;
10979 const ENCODED_LEN: usize = 53usize;
10980 fn deser(
10981 _version: MavlinkVersion,
10982 __input: &[u8],
10983 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10984 let avail_len = __input.len();
10985 let mut payload_buf = [0; Self::ENCODED_LEN];
10986 let mut buf = if avail_len < Self::ENCODED_LEN {
10987 payload_buf[0..avail_len].copy_from_slice(__input);
10988 Bytes::new(&payload_buf)
10989 } else {
10990 Bytes::new(__input)
10991 };
10992 let mut __struct = Self::default();
10993 __struct.id = buf.get_u32_le();
10994 __struct.event_time_boot_ms = buf.get_u32_le();
10995 __struct.sequence = buf.get_u16_le();
10996 __struct.destination_component = buf.get_u8();
10997 __struct.destination_system = buf.get_u8();
10998 __struct.log_levels = buf.get_u8();
10999 for v in &mut __struct.arguments {
11000 let val = buf.get_u8();
11001 *v = val;
11002 }
11003 Ok(__struct)
11004 }
11005 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11006 let mut __tmp = BytesMut::new(bytes);
11007 #[allow(clippy::absurd_extreme_comparisons)]
11008 #[allow(unused_comparisons)]
11009 if __tmp.remaining() < Self::ENCODED_LEN {
11010 panic!(
11011 "buffer is too small (need {} bytes, but got {})",
11012 Self::ENCODED_LEN,
11013 __tmp.remaining(),
11014 )
11015 }
11016 __tmp.put_u32_le(self.id);
11017 __tmp.put_u32_le(self.event_time_boot_ms);
11018 __tmp.put_u16_le(self.sequence);
11019 __tmp.put_u8(self.destination_component);
11020 __tmp.put_u8(self.destination_system);
11021 __tmp.put_u8(self.log_levels);
11022 for val in &self.arguments {
11023 __tmp.put_u8(*val);
11024 }
11025 if matches!(version, MavlinkVersion::V2) {
11026 let len = __tmp.len();
11027 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11028 } else {
11029 __tmp.len()
11030 }
11031 }
11032}
11033#[doc = "Provides state for additional features."]
11034#[doc = ""]
11035#[doc = "ID: 245"]
11036#[derive(Debug, Clone, PartialEq)]
11037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11038#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11039pub struct EXTENDED_SYS_STATE_DATA {
11040 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11041 pub vtol_state: MavVtolState,
11042 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11043 pub landed_state: MavLandedState,
11044}
11045impl EXTENDED_SYS_STATE_DATA {
11046 pub const ENCODED_LEN: usize = 2usize;
11047 pub const DEFAULT: Self = Self {
11048 vtol_state: MavVtolState::DEFAULT,
11049 landed_state: MavLandedState::DEFAULT,
11050 };
11051 #[cfg(feature = "arbitrary")]
11052 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11053 use arbitrary::{Arbitrary, Unstructured};
11054 let mut buf = [0u8; 1024];
11055 rng.fill_bytes(&mut buf);
11056 let mut unstructured = Unstructured::new(&buf);
11057 Self::arbitrary(&mut unstructured).unwrap_or_default()
11058 }
11059}
11060impl Default for EXTENDED_SYS_STATE_DATA {
11061 fn default() -> Self {
11062 Self::DEFAULT.clone()
11063 }
11064}
11065impl MessageData for EXTENDED_SYS_STATE_DATA {
11066 type Message = MavMessage;
11067 const ID: u32 = 245u32;
11068 const NAME: &'static str = "EXTENDED_SYS_STATE";
11069 const EXTRA_CRC: u8 = 130u8;
11070 const ENCODED_LEN: usize = 2usize;
11071 fn deser(
11072 _version: MavlinkVersion,
11073 __input: &[u8],
11074 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11075 let avail_len = __input.len();
11076 let mut payload_buf = [0; Self::ENCODED_LEN];
11077 let mut buf = if avail_len < Self::ENCODED_LEN {
11078 payload_buf[0..avail_len].copy_from_slice(__input);
11079 Bytes::new(&payload_buf)
11080 } else {
11081 Bytes::new(__input)
11082 };
11083 let mut __struct = Self::default();
11084 let tmp = buf.get_u8();
11085 __struct.vtol_state =
11086 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11087 enum_type: "MavVtolState",
11088 value: tmp as u32,
11089 })?;
11090 let tmp = buf.get_u8();
11091 __struct.landed_state =
11092 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11093 enum_type: "MavLandedState",
11094 value: tmp as u32,
11095 })?;
11096 Ok(__struct)
11097 }
11098 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11099 let mut __tmp = BytesMut::new(bytes);
11100 #[allow(clippy::absurd_extreme_comparisons)]
11101 #[allow(unused_comparisons)]
11102 if __tmp.remaining() < Self::ENCODED_LEN {
11103 panic!(
11104 "buffer is too small (need {} bytes, but got {})",
11105 Self::ENCODED_LEN,
11106 __tmp.remaining(),
11107 )
11108 }
11109 __tmp.put_u8(self.vtol_state as u8);
11110 __tmp.put_u8(self.landed_state as u8);
11111 if matches!(version, MavlinkVersion::V2) {
11112 let len = __tmp.len();
11113 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11114 } else {
11115 __tmp.len()
11116 }
11117 }
11118}
11119#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11120#[doc = ""]
11121#[doc = "ID: 162"]
11122#[derive(Debug, Clone, PartialEq)]
11123#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11124#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11125pub struct FENCE_STATUS_DATA {
11126 #[doc = "Time (since boot) of last breach."]
11127 pub breach_time: u32,
11128 #[doc = "Number of fence breaches."]
11129 pub breach_count: u16,
11130 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11131 pub breach_status: u8,
11132 #[doc = "Last breach type."]
11133 pub breach_type: FenceBreach,
11134 #[doc = "Active action to prevent fence breach"]
11135 #[cfg_attr(feature = "serde", serde(default))]
11136 pub breach_mitigation: FenceMitigate,
11137}
11138impl FENCE_STATUS_DATA {
11139 pub const ENCODED_LEN: usize = 9usize;
11140 pub const DEFAULT: Self = Self {
11141 breach_time: 0_u32,
11142 breach_count: 0_u16,
11143 breach_status: 0_u8,
11144 breach_type: FenceBreach::DEFAULT,
11145 breach_mitigation: FenceMitigate::DEFAULT,
11146 };
11147 #[cfg(feature = "arbitrary")]
11148 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11149 use arbitrary::{Arbitrary, Unstructured};
11150 let mut buf = [0u8; 1024];
11151 rng.fill_bytes(&mut buf);
11152 let mut unstructured = Unstructured::new(&buf);
11153 Self::arbitrary(&mut unstructured).unwrap_or_default()
11154 }
11155}
11156impl Default for FENCE_STATUS_DATA {
11157 fn default() -> Self {
11158 Self::DEFAULT.clone()
11159 }
11160}
11161impl MessageData for FENCE_STATUS_DATA {
11162 type Message = MavMessage;
11163 const ID: u32 = 162u32;
11164 const NAME: &'static str = "FENCE_STATUS";
11165 const EXTRA_CRC: u8 = 189u8;
11166 const ENCODED_LEN: usize = 9usize;
11167 fn deser(
11168 _version: MavlinkVersion,
11169 __input: &[u8],
11170 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11171 let avail_len = __input.len();
11172 let mut payload_buf = [0; Self::ENCODED_LEN];
11173 let mut buf = if avail_len < Self::ENCODED_LEN {
11174 payload_buf[0..avail_len].copy_from_slice(__input);
11175 Bytes::new(&payload_buf)
11176 } else {
11177 Bytes::new(__input)
11178 };
11179 let mut __struct = Self::default();
11180 __struct.breach_time = buf.get_u32_le();
11181 __struct.breach_count = buf.get_u16_le();
11182 __struct.breach_status = buf.get_u8();
11183 let tmp = buf.get_u8();
11184 __struct.breach_type =
11185 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11186 enum_type: "FenceBreach",
11187 value: tmp as u32,
11188 })?;
11189 let tmp = buf.get_u8();
11190 __struct.breach_mitigation =
11191 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11192 enum_type: "FenceMitigate",
11193 value: tmp as u32,
11194 })?;
11195 Ok(__struct)
11196 }
11197 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11198 let mut __tmp = BytesMut::new(bytes);
11199 #[allow(clippy::absurd_extreme_comparisons)]
11200 #[allow(unused_comparisons)]
11201 if __tmp.remaining() < Self::ENCODED_LEN {
11202 panic!(
11203 "buffer is too small (need {} bytes, but got {})",
11204 Self::ENCODED_LEN,
11205 __tmp.remaining(),
11206 )
11207 }
11208 __tmp.put_u32_le(self.breach_time);
11209 __tmp.put_u16_le(self.breach_count);
11210 __tmp.put_u8(self.breach_status);
11211 __tmp.put_u8(self.breach_type as u8);
11212 if matches!(version, MavlinkVersion::V2) {
11213 __tmp.put_u8(self.breach_mitigation as u8);
11214 let len = __tmp.len();
11215 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11216 } else {
11217 __tmp.len()
11218 }
11219 }
11220}
11221#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11222#[doc = ""]
11223#[doc = "ID: 110"]
11224#[derive(Debug, Clone, PartialEq)]
11225#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11226#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11227pub struct FILE_TRANSFER_PROTOCOL_DATA {
11228 #[doc = "Network ID (0 for broadcast)"]
11229 pub target_network: u8,
11230 #[doc = "System ID (0 for broadcast)"]
11231 pub target_system: u8,
11232 #[doc = "Component ID (0 for broadcast)"]
11233 pub target_component: u8,
11234 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11235 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11236 pub payload: [u8; 251],
11237}
11238impl FILE_TRANSFER_PROTOCOL_DATA {
11239 pub const ENCODED_LEN: usize = 254usize;
11240 pub const DEFAULT: Self = Self {
11241 target_network: 0_u8,
11242 target_system: 0_u8,
11243 target_component: 0_u8,
11244 payload: [0_u8; 251usize],
11245 };
11246 #[cfg(feature = "arbitrary")]
11247 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11248 use arbitrary::{Arbitrary, Unstructured};
11249 let mut buf = [0u8; 1024];
11250 rng.fill_bytes(&mut buf);
11251 let mut unstructured = Unstructured::new(&buf);
11252 Self::arbitrary(&mut unstructured).unwrap_or_default()
11253 }
11254}
11255impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11256 fn default() -> Self {
11257 Self::DEFAULT.clone()
11258 }
11259}
11260impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11261 type Message = MavMessage;
11262 const ID: u32 = 110u32;
11263 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11264 const EXTRA_CRC: u8 = 84u8;
11265 const ENCODED_LEN: usize = 254usize;
11266 fn deser(
11267 _version: MavlinkVersion,
11268 __input: &[u8],
11269 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11270 let avail_len = __input.len();
11271 let mut payload_buf = [0; Self::ENCODED_LEN];
11272 let mut buf = if avail_len < Self::ENCODED_LEN {
11273 payload_buf[0..avail_len].copy_from_slice(__input);
11274 Bytes::new(&payload_buf)
11275 } else {
11276 Bytes::new(__input)
11277 };
11278 let mut __struct = Self::default();
11279 __struct.target_network = buf.get_u8();
11280 __struct.target_system = buf.get_u8();
11281 __struct.target_component = buf.get_u8();
11282 for v in &mut __struct.payload {
11283 let val = buf.get_u8();
11284 *v = val;
11285 }
11286 Ok(__struct)
11287 }
11288 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11289 let mut __tmp = BytesMut::new(bytes);
11290 #[allow(clippy::absurd_extreme_comparisons)]
11291 #[allow(unused_comparisons)]
11292 if __tmp.remaining() < Self::ENCODED_LEN {
11293 panic!(
11294 "buffer is too small (need {} bytes, but got {})",
11295 Self::ENCODED_LEN,
11296 __tmp.remaining(),
11297 )
11298 }
11299 __tmp.put_u8(self.target_network);
11300 __tmp.put_u8(self.target_system);
11301 __tmp.put_u8(self.target_component);
11302 for val in &self.payload {
11303 __tmp.put_u8(*val);
11304 }
11305 if matches!(version, MavlinkVersion::V2) {
11306 let len = __tmp.len();
11307 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11308 } else {
11309 __tmp.len()
11310 }
11311 }
11312}
11313#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11314#[doc = ""]
11315#[doc = "ID: 264"]
11316#[derive(Debug, Clone, PartialEq)]
11317#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11319pub struct FLIGHT_INFORMATION_DATA {
11320 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11321 pub arming_time_utc: u64,
11322 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11323 pub takeoff_time_utc: u64,
11324 #[doc = "Flight number. Note, field is misnamed UUID."]
11325 pub flight_uuid: u64,
11326 #[doc = "Timestamp (time since system boot)."]
11327 pub time_boot_ms: u32,
11328 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11329 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11330 pub landing_time: u32,
11331}
11332impl FLIGHT_INFORMATION_DATA {
11333 pub const ENCODED_LEN: usize = 32usize;
11334 pub const DEFAULT: Self = Self {
11335 arming_time_utc: 0_u64,
11336 takeoff_time_utc: 0_u64,
11337 flight_uuid: 0_u64,
11338 time_boot_ms: 0_u32,
11339 landing_time: 0_u32,
11340 };
11341 #[cfg(feature = "arbitrary")]
11342 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11343 use arbitrary::{Arbitrary, Unstructured};
11344 let mut buf = [0u8; 1024];
11345 rng.fill_bytes(&mut buf);
11346 let mut unstructured = Unstructured::new(&buf);
11347 Self::arbitrary(&mut unstructured).unwrap_or_default()
11348 }
11349}
11350impl Default for FLIGHT_INFORMATION_DATA {
11351 fn default() -> Self {
11352 Self::DEFAULT.clone()
11353 }
11354}
11355impl MessageData for FLIGHT_INFORMATION_DATA {
11356 type Message = MavMessage;
11357 const ID: u32 = 264u32;
11358 const NAME: &'static str = "FLIGHT_INFORMATION";
11359 const EXTRA_CRC: u8 = 49u8;
11360 const ENCODED_LEN: usize = 32usize;
11361 fn deser(
11362 _version: MavlinkVersion,
11363 __input: &[u8],
11364 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11365 let avail_len = __input.len();
11366 let mut payload_buf = [0; Self::ENCODED_LEN];
11367 let mut buf = if avail_len < Self::ENCODED_LEN {
11368 payload_buf[0..avail_len].copy_from_slice(__input);
11369 Bytes::new(&payload_buf)
11370 } else {
11371 Bytes::new(__input)
11372 };
11373 let mut __struct = Self::default();
11374 __struct.arming_time_utc = buf.get_u64_le();
11375 __struct.takeoff_time_utc = buf.get_u64_le();
11376 __struct.flight_uuid = buf.get_u64_le();
11377 __struct.time_boot_ms = buf.get_u32_le();
11378 __struct.landing_time = buf.get_u32_le();
11379 Ok(__struct)
11380 }
11381 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11382 let mut __tmp = BytesMut::new(bytes);
11383 #[allow(clippy::absurd_extreme_comparisons)]
11384 #[allow(unused_comparisons)]
11385 if __tmp.remaining() < Self::ENCODED_LEN {
11386 panic!(
11387 "buffer is too small (need {} bytes, but got {})",
11388 Self::ENCODED_LEN,
11389 __tmp.remaining(),
11390 )
11391 }
11392 __tmp.put_u64_le(self.arming_time_utc);
11393 __tmp.put_u64_le(self.takeoff_time_utc);
11394 __tmp.put_u64_le(self.flight_uuid);
11395 __tmp.put_u32_le(self.time_boot_ms);
11396 if matches!(version, MavlinkVersion::V2) {
11397 __tmp.put_u32_le(self.landing_time);
11398 let len = __tmp.len();
11399 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11400 } else {
11401 __tmp.len()
11402 }
11403 }
11404}
11405#[doc = "Current motion information from a designated system."]
11406#[doc = ""]
11407#[doc = "ID: 144"]
11408#[derive(Debug, Clone, PartialEq)]
11409#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11410#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11411pub struct FOLLOW_TARGET_DATA {
11412 #[doc = "Timestamp (time since system boot)."]
11413 pub timestamp: u64,
11414 #[doc = "button states or switches of a tracker device"]
11415 pub custom_state: u64,
11416 #[doc = "Latitude (WGS84)"]
11417 pub lat: i32,
11418 #[doc = "Longitude (WGS84)"]
11419 pub lon: i32,
11420 #[doc = "Altitude (MSL)"]
11421 pub alt: f32,
11422 #[doc = "target velocity (0,0,0) for unknown"]
11423 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11424 pub vel: [f32; 3],
11425 #[doc = "linear target acceleration (0,0,0) for unknown"]
11426 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11427 pub acc: [f32; 3],
11428 #[doc = "(0 0 0 0 for unknown)"]
11429 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11430 pub attitude_q: [f32; 4],
11431 #[doc = "(0 0 0 for unknown)"]
11432 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11433 pub rates: [f32; 3],
11434 #[doc = "eph epv"]
11435 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11436 pub position_cov: [f32; 3],
11437 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
11438 pub est_capabilities: u8,
11439}
11440impl FOLLOW_TARGET_DATA {
11441 pub const ENCODED_LEN: usize = 93usize;
11442 pub const DEFAULT: Self = Self {
11443 timestamp: 0_u64,
11444 custom_state: 0_u64,
11445 lat: 0_i32,
11446 lon: 0_i32,
11447 alt: 0.0_f32,
11448 vel: [0.0_f32; 3usize],
11449 acc: [0.0_f32; 3usize],
11450 attitude_q: [0.0_f32; 4usize],
11451 rates: [0.0_f32; 3usize],
11452 position_cov: [0.0_f32; 3usize],
11453 est_capabilities: 0_u8,
11454 };
11455 #[cfg(feature = "arbitrary")]
11456 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11457 use arbitrary::{Arbitrary, Unstructured};
11458 let mut buf = [0u8; 1024];
11459 rng.fill_bytes(&mut buf);
11460 let mut unstructured = Unstructured::new(&buf);
11461 Self::arbitrary(&mut unstructured).unwrap_or_default()
11462 }
11463}
11464impl Default for FOLLOW_TARGET_DATA {
11465 fn default() -> Self {
11466 Self::DEFAULT.clone()
11467 }
11468}
11469impl MessageData for FOLLOW_TARGET_DATA {
11470 type Message = MavMessage;
11471 const ID: u32 = 144u32;
11472 const NAME: &'static str = "FOLLOW_TARGET";
11473 const EXTRA_CRC: u8 = 127u8;
11474 const ENCODED_LEN: usize = 93usize;
11475 fn deser(
11476 _version: MavlinkVersion,
11477 __input: &[u8],
11478 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11479 let avail_len = __input.len();
11480 let mut payload_buf = [0; Self::ENCODED_LEN];
11481 let mut buf = if avail_len < Self::ENCODED_LEN {
11482 payload_buf[0..avail_len].copy_from_slice(__input);
11483 Bytes::new(&payload_buf)
11484 } else {
11485 Bytes::new(__input)
11486 };
11487 let mut __struct = Self::default();
11488 __struct.timestamp = buf.get_u64_le();
11489 __struct.custom_state = buf.get_u64_le();
11490 __struct.lat = buf.get_i32_le();
11491 __struct.lon = buf.get_i32_le();
11492 __struct.alt = buf.get_f32_le();
11493 for v in &mut __struct.vel {
11494 let val = buf.get_f32_le();
11495 *v = val;
11496 }
11497 for v in &mut __struct.acc {
11498 let val = buf.get_f32_le();
11499 *v = val;
11500 }
11501 for v in &mut __struct.attitude_q {
11502 let val = buf.get_f32_le();
11503 *v = val;
11504 }
11505 for v in &mut __struct.rates {
11506 let val = buf.get_f32_le();
11507 *v = val;
11508 }
11509 for v in &mut __struct.position_cov {
11510 let val = buf.get_f32_le();
11511 *v = val;
11512 }
11513 __struct.est_capabilities = buf.get_u8();
11514 Ok(__struct)
11515 }
11516 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11517 let mut __tmp = BytesMut::new(bytes);
11518 #[allow(clippy::absurd_extreme_comparisons)]
11519 #[allow(unused_comparisons)]
11520 if __tmp.remaining() < Self::ENCODED_LEN {
11521 panic!(
11522 "buffer is too small (need {} bytes, but got {})",
11523 Self::ENCODED_LEN,
11524 __tmp.remaining(),
11525 )
11526 }
11527 __tmp.put_u64_le(self.timestamp);
11528 __tmp.put_u64_le(self.custom_state);
11529 __tmp.put_i32_le(self.lat);
11530 __tmp.put_i32_le(self.lon);
11531 __tmp.put_f32_le(self.alt);
11532 for val in &self.vel {
11533 __tmp.put_f32_le(*val);
11534 }
11535 for val in &self.acc {
11536 __tmp.put_f32_le(*val);
11537 }
11538 for val in &self.attitude_q {
11539 __tmp.put_f32_le(*val);
11540 }
11541 for val in &self.rates {
11542 __tmp.put_f32_le(*val);
11543 }
11544 for val in &self.position_cov {
11545 __tmp.put_f32_le(*val);
11546 }
11547 __tmp.put_u8(self.est_capabilities);
11548 if matches!(version, MavlinkVersion::V2) {
11549 let len = __tmp.len();
11550 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11551 } else {
11552 __tmp.len()
11553 }
11554 }
11555}
11556#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
11557#[doc = ""]
11558#[doc = "ID: 371"]
11559#[derive(Debug, Clone, PartialEq)]
11560#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11561#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11562pub struct FUEL_STATUS_DATA {
11563 #[doc = "Capacity when full. Must be provided."]
11564 pub maximum_fuel: f32,
11565 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11566 pub consumed_fuel: f32,
11567 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11568 pub remaining_fuel: f32,
11569 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
11570 pub flow_rate: f32,
11571 #[doc = "Fuel temperature. NaN: field not provided."]
11572 pub temperature: f32,
11573 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
11574 pub fuel_type: MavFuelType,
11575 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
11576 pub id: u8,
11577 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
11578 pub percent_remaining: u8,
11579}
11580impl FUEL_STATUS_DATA {
11581 pub const ENCODED_LEN: usize = 26usize;
11582 pub const DEFAULT: Self = Self {
11583 maximum_fuel: 0.0_f32,
11584 consumed_fuel: 0.0_f32,
11585 remaining_fuel: 0.0_f32,
11586 flow_rate: 0.0_f32,
11587 temperature: 0.0_f32,
11588 fuel_type: MavFuelType::DEFAULT,
11589 id: 0_u8,
11590 percent_remaining: 0_u8,
11591 };
11592 #[cfg(feature = "arbitrary")]
11593 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11594 use arbitrary::{Arbitrary, Unstructured};
11595 let mut buf = [0u8; 1024];
11596 rng.fill_bytes(&mut buf);
11597 let mut unstructured = Unstructured::new(&buf);
11598 Self::arbitrary(&mut unstructured).unwrap_or_default()
11599 }
11600}
11601impl Default for FUEL_STATUS_DATA {
11602 fn default() -> Self {
11603 Self::DEFAULT.clone()
11604 }
11605}
11606impl MessageData for FUEL_STATUS_DATA {
11607 type Message = MavMessage;
11608 const ID: u32 = 371u32;
11609 const NAME: &'static str = "FUEL_STATUS";
11610 const EXTRA_CRC: u8 = 10u8;
11611 const ENCODED_LEN: usize = 26usize;
11612 fn deser(
11613 _version: MavlinkVersion,
11614 __input: &[u8],
11615 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11616 let avail_len = __input.len();
11617 let mut payload_buf = [0; Self::ENCODED_LEN];
11618 let mut buf = if avail_len < Self::ENCODED_LEN {
11619 payload_buf[0..avail_len].copy_from_slice(__input);
11620 Bytes::new(&payload_buf)
11621 } else {
11622 Bytes::new(__input)
11623 };
11624 let mut __struct = Self::default();
11625 __struct.maximum_fuel = buf.get_f32_le();
11626 __struct.consumed_fuel = buf.get_f32_le();
11627 __struct.remaining_fuel = buf.get_f32_le();
11628 __struct.flow_rate = buf.get_f32_le();
11629 __struct.temperature = buf.get_f32_le();
11630 let tmp = buf.get_u32_le();
11631 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
11632 ::mavlink_core::error::ParserError::InvalidEnum {
11633 enum_type: "MavFuelType",
11634 value: tmp as u32,
11635 },
11636 )?;
11637 __struct.id = buf.get_u8();
11638 __struct.percent_remaining = buf.get_u8();
11639 Ok(__struct)
11640 }
11641 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11642 let mut __tmp = BytesMut::new(bytes);
11643 #[allow(clippy::absurd_extreme_comparisons)]
11644 #[allow(unused_comparisons)]
11645 if __tmp.remaining() < Self::ENCODED_LEN {
11646 panic!(
11647 "buffer is too small (need {} bytes, but got {})",
11648 Self::ENCODED_LEN,
11649 __tmp.remaining(),
11650 )
11651 }
11652 __tmp.put_f32_le(self.maximum_fuel);
11653 __tmp.put_f32_le(self.consumed_fuel);
11654 __tmp.put_f32_le(self.remaining_fuel);
11655 __tmp.put_f32_le(self.flow_rate);
11656 __tmp.put_f32_le(self.temperature);
11657 __tmp.put_u32_le(self.fuel_type as u32);
11658 __tmp.put_u8(self.id);
11659 __tmp.put_u8(self.percent_remaining);
11660 if matches!(version, MavlinkVersion::V2) {
11661 let len = __tmp.len();
11662 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11663 } else {
11664 __tmp.len()
11665 }
11666 }
11667}
11668#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
11669#[doc = ""]
11670#[doc = "ID: 373"]
11671#[derive(Debug, Clone, PartialEq)]
11672#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11674pub struct GENERATOR_STATUS_DATA {
11675 #[doc = "Status flags."]
11676 pub status: MavGeneratorStatusFlag,
11677 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
11678 pub battery_current: f32,
11679 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
11680 pub load_current: f32,
11681 #[doc = "The power being generated. NaN: field not provided"]
11682 pub power_generated: f32,
11683 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
11684 pub bus_voltage: f32,
11685 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
11686 pub bat_current_setpoint: f32,
11687 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
11688 pub runtime: u32,
11689 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
11690 pub time_until_maintenance: i32,
11691 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
11692 pub generator_speed: u16,
11693 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
11694 pub rectifier_temperature: i16,
11695 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
11696 pub generator_temperature: i16,
11697}
11698impl GENERATOR_STATUS_DATA {
11699 pub const ENCODED_LEN: usize = 42usize;
11700 pub const DEFAULT: Self = Self {
11701 status: MavGeneratorStatusFlag::DEFAULT,
11702 battery_current: 0.0_f32,
11703 load_current: 0.0_f32,
11704 power_generated: 0.0_f32,
11705 bus_voltage: 0.0_f32,
11706 bat_current_setpoint: 0.0_f32,
11707 runtime: 0_u32,
11708 time_until_maintenance: 0_i32,
11709 generator_speed: 0_u16,
11710 rectifier_temperature: 0_i16,
11711 generator_temperature: 0_i16,
11712 };
11713 #[cfg(feature = "arbitrary")]
11714 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11715 use arbitrary::{Arbitrary, Unstructured};
11716 let mut buf = [0u8; 1024];
11717 rng.fill_bytes(&mut buf);
11718 let mut unstructured = Unstructured::new(&buf);
11719 Self::arbitrary(&mut unstructured).unwrap_or_default()
11720 }
11721}
11722impl Default for GENERATOR_STATUS_DATA {
11723 fn default() -> Self {
11724 Self::DEFAULT.clone()
11725 }
11726}
11727impl MessageData for GENERATOR_STATUS_DATA {
11728 type Message = MavMessage;
11729 const ID: u32 = 373u32;
11730 const NAME: &'static str = "GENERATOR_STATUS";
11731 const EXTRA_CRC: u8 = 117u8;
11732 const ENCODED_LEN: usize = 42usize;
11733 fn deser(
11734 _version: MavlinkVersion,
11735 __input: &[u8],
11736 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11737 let avail_len = __input.len();
11738 let mut payload_buf = [0; Self::ENCODED_LEN];
11739 let mut buf = if avail_len < Self::ENCODED_LEN {
11740 payload_buf[0..avail_len].copy_from_slice(__input);
11741 Bytes::new(&payload_buf)
11742 } else {
11743 Bytes::new(__input)
11744 };
11745 let mut __struct = Self::default();
11746 let tmp = buf.get_u64_le();
11747 __struct.status = MavGeneratorStatusFlag::from_bits(
11748 tmp & MavGeneratorStatusFlag::all().bits(),
11749 )
11750 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11751 flag_type: "MavGeneratorStatusFlag",
11752 value: tmp as u32,
11753 })?;
11754 __struct.battery_current = buf.get_f32_le();
11755 __struct.load_current = buf.get_f32_le();
11756 __struct.power_generated = buf.get_f32_le();
11757 __struct.bus_voltage = buf.get_f32_le();
11758 __struct.bat_current_setpoint = buf.get_f32_le();
11759 __struct.runtime = buf.get_u32_le();
11760 __struct.time_until_maintenance = buf.get_i32_le();
11761 __struct.generator_speed = buf.get_u16_le();
11762 __struct.rectifier_temperature = buf.get_i16_le();
11763 __struct.generator_temperature = buf.get_i16_le();
11764 Ok(__struct)
11765 }
11766 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11767 let mut __tmp = BytesMut::new(bytes);
11768 #[allow(clippy::absurd_extreme_comparisons)]
11769 #[allow(unused_comparisons)]
11770 if __tmp.remaining() < Self::ENCODED_LEN {
11771 panic!(
11772 "buffer is too small (need {} bytes, but got {})",
11773 Self::ENCODED_LEN,
11774 __tmp.remaining(),
11775 )
11776 }
11777 __tmp.put_u64_le(self.status.bits());
11778 __tmp.put_f32_le(self.battery_current);
11779 __tmp.put_f32_le(self.load_current);
11780 __tmp.put_f32_le(self.power_generated);
11781 __tmp.put_f32_le(self.bus_voltage);
11782 __tmp.put_f32_le(self.bat_current_setpoint);
11783 __tmp.put_u32_le(self.runtime);
11784 __tmp.put_i32_le(self.time_until_maintenance);
11785 __tmp.put_u16_le(self.generator_speed);
11786 __tmp.put_i16_le(self.rectifier_temperature);
11787 __tmp.put_i16_le(self.generator_temperature);
11788 if matches!(version, MavlinkVersion::V2) {
11789 let len = __tmp.len();
11790 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11791 } else {
11792 __tmp.len()
11793 }
11794 }
11795}
11796#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
11797#[doc = ""]
11798#[doc = "ID: 285"]
11799#[derive(Debug, Clone, PartialEq)]
11800#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11801#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11802pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11803 #[doc = "Timestamp (time since system boot)."]
11804 pub time_boot_ms: u32,
11805 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
11806 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11807 pub q: [f32; 4],
11808 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
11809 pub angular_velocity_x: f32,
11810 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
11811 pub angular_velocity_y: f32,
11812 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
11813 pub angular_velocity_z: f32,
11814 #[doc = "Failure flags (0 for no failure)"]
11815 pub failure_flags: GimbalDeviceErrorFlags,
11816 #[doc = "Current gimbal flags set."]
11817 pub flags: GimbalDeviceFlags,
11818 #[doc = "System ID"]
11819 pub target_system: u8,
11820 #[doc = "Component ID"]
11821 pub target_component: u8,
11822 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
11823 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11824 pub delta_yaw: f32,
11825 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
11826 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11827 pub delta_yaw_velocity: f32,
11828 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
11829 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11830 pub gimbal_device_id: u8,
11831}
11832impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11833 pub const ENCODED_LEN: usize = 49usize;
11834 pub const DEFAULT: Self = Self {
11835 time_boot_ms: 0_u32,
11836 q: [0.0_f32; 4usize],
11837 angular_velocity_x: 0.0_f32,
11838 angular_velocity_y: 0.0_f32,
11839 angular_velocity_z: 0.0_f32,
11840 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
11841 flags: GimbalDeviceFlags::DEFAULT,
11842 target_system: 0_u8,
11843 target_component: 0_u8,
11844 delta_yaw: 0.0_f32,
11845 delta_yaw_velocity: 0.0_f32,
11846 gimbal_device_id: 0_u8,
11847 };
11848 #[cfg(feature = "arbitrary")]
11849 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11850 use arbitrary::{Arbitrary, Unstructured};
11851 let mut buf = [0u8; 1024];
11852 rng.fill_bytes(&mut buf);
11853 let mut unstructured = Unstructured::new(&buf);
11854 Self::arbitrary(&mut unstructured).unwrap_or_default()
11855 }
11856}
11857impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11858 fn default() -> Self {
11859 Self::DEFAULT.clone()
11860 }
11861}
11862impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11863 type Message = MavMessage;
11864 const ID: u32 = 285u32;
11865 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
11866 const EXTRA_CRC: u8 = 137u8;
11867 const ENCODED_LEN: usize = 49usize;
11868 fn deser(
11869 _version: MavlinkVersion,
11870 __input: &[u8],
11871 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11872 let avail_len = __input.len();
11873 let mut payload_buf = [0; Self::ENCODED_LEN];
11874 let mut buf = if avail_len < Self::ENCODED_LEN {
11875 payload_buf[0..avail_len].copy_from_slice(__input);
11876 Bytes::new(&payload_buf)
11877 } else {
11878 Bytes::new(__input)
11879 };
11880 let mut __struct = Self::default();
11881 __struct.time_boot_ms = buf.get_u32_le();
11882 for v in &mut __struct.q {
11883 let val = buf.get_f32_le();
11884 *v = val;
11885 }
11886 __struct.angular_velocity_x = buf.get_f32_le();
11887 __struct.angular_velocity_y = buf.get_f32_le();
11888 __struct.angular_velocity_z = buf.get_f32_le();
11889 let tmp = buf.get_u32_le();
11890 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
11891 tmp & GimbalDeviceErrorFlags::all().bits(),
11892 )
11893 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11894 flag_type: "GimbalDeviceErrorFlags",
11895 value: tmp as u32,
11896 })?;
11897 let tmp = buf.get_u16_le();
11898 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
11899 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11900 flag_type: "GimbalDeviceFlags",
11901 value: tmp as u32,
11902 })?;
11903 __struct.target_system = buf.get_u8();
11904 __struct.target_component = buf.get_u8();
11905 __struct.delta_yaw = buf.get_f32_le();
11906 __struct.delta_yaw_velocity = buf.get_f32_le();
11907 __struct.gimbal_device_id = buf.get_u8();
11908 Ok(__struct)
11909 }
11910 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11911 let mut __tmp = BytesMut::new(bytes);
11912 #[allow(clippy::absurd_extreme_comparisons)]
11913 #[allow(unused_comparisons)]
11914 if __tmp.remaining() < Self::ENCODED_LEN {
11915 panic!(
11916 "buffer is too small (need {} bytes, but got {})",
11917 Self::ENCODED_LEN,
11918 __tmp.remaining(),
11919 )
11920 }
11921 __tmp.put_u32_le(self.time_boot_ms);
11922 for val in &self.q {
11923 __tmp.put_f32_le(*val);
11924 }
11925 __tmp.put_f32_le(self.angular_velocity_x);
11926 __tmp.put_f32_le(self.angular_velocity_y);
11927 __tmp.put_f32_le(self.angular_velocity_z);
11928 __tmp.put_u32_le(self.failure_flags.bits());
11929 __tmp.put_u16_le(self.flags.bits());
11930 __tmp.put_u8(self.target_system);
11931 __tmp.put_u8(self.target_component);
11932 if matches!(version, MavlinkVersion::V2) {
11933 __tmp.put_f32_le(self.delta_yaw);
11934 __tmp.put_f32_le(self.delta_yaw_velocity);
11935 __tmp.put_u8(self.gimbal_device_id);
11936 let len = __tmp.len();
11937 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11938 } else {
11939 __tmp.len()
11940 }
11941 }
11942}
11943#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
11944#[doc = ""]
11945#[doc = "ID: 283"]
11946#[derive(Debug, Clone, PartialEq)]
11947#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11948#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11949pub struct GIMBAL_DEVICE_INFORMATION_DATA {
11950 #[doc = "UID of gimbal hardware (0 if unknown)."]
11951 pub uid: u64,
11952 #[doc = "Timestamp (time since system boot)."]
11953 pub time_boot_ms: u32,
11954 #[doc = "0xff)."]
11955 pub firmware_version: u32,
11956 #[doc = "0xff)."]
11957 pub hardware_version: u32,
11958 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
11959 pub roll_min: f32,
11960 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
11961 pub roll_max: f32,
11962 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
11963 pub pitch_min: f32,
11964 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
11965 pub pitch_max: f32,
11966 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
11967 pub yaw_min: f32,
11968 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
11969 pub yaw_max: f32,
11970 #[doc = "Bitmap of gimbal capability flags."]
11971 pub cap_flags: GimbalDeviceCapFlags,
11972 #[doc = "Bitmap for use for gimbal-specific capability flags."]
11973 pub custom_cap_flags: u16,
11974 #[doc = "Name of the gimbal vendor."]
11975 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11976 pub vendor_name: [u8; 32],
11977 #[doc = "Name of the gimbal model."]
11978 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11979 pub model_name: [u8; 32],
11980 #[doc = "Custom name of the gimbal given to it by the user."]
11981 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11982 pub custom_name: [u8; 32],
11983 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
11984 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11985 pub gimbal_device_id: u8,
11986}
11987impl GIMBAL_DEVICE_INFORMATION_DATA {
11988 pub const ENCODED_LEN: usize = 145usize;
11989 pub const DEFAULT: Self = Self {
11990 uid: 0_u64,
11991 time_boot_ms: 0_u32,
11992 firmware_version: 0_u32,
11993 hardware_version: 0_u32,
11994 roll_min: 0.0_f32,
11995 roll_max: 0.0_f32,
11996 pitch_min: 0.0_f32,
11997 pitch_max: 0.0_f32,
11998 yaw_min: 0.0_f32,
11999 yaw_max: 0.0_f32,
12000 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12001 custom_cap_flags: 0_u16,
12002 vendor_name: [0_u8; 32usize],
12003 model_name: [0_u8; 32usize],
12004 custom_name: [0_u8; 32usize],
12005 gimbal_device_id: 0_u8,
12006 };
12007 #[cfg(feature = "arbitrary")]
12008 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12009 use arbitrary::{Arbitrary, Unstructured};
12010 let mut buf = [0u8; 1024];
12011 rng.fill_bytes(&mut buf);
12012 let mut unstructured = Unstructured::new(&buf);
12013 Self::arbitrary(&mut unstructured).unwrap_or_default()
12014 }
12015}
12016impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12017 fn default() -> Self {
12018 Self::DEFAULT.clone()
12019 }
12020}
12021impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12022 type Message = MavMessage;
12023 const ID: u32 = 283u32;
12024 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12025 const EXTRA_CRC: u8 = 74u8;
12026 const ENCODED_LEN: usize = 145usize;
12027 fn deser(
12028 _version: MavlinkVersion,
12029 __input: &[u8],
12030 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12031 let avail_len = __input.len();
12032 let mut payload_buf = [0; Self::ENCODED_LEN];
12033 let mut buf = if avail_len < Self::ENCODED_LEN {
12034 payload_buf[0..avail_len].copy_from_slice(__input);
12035 Bytes::new(&payload_buf)
12036 } else {
12037 Bytes::new(__input)
12038 };
12039 let mut __struct = Self::default();
12040 __struct.uid = buf.get_u64_le();
12041 __struct.time_boot_ms = buf.get_u32_le();
12042 __struct.firmware_version = buf.get_u32_le();
12043 __struct.hardware_version = buf.get_u32_le();
12044 __struct.roll_min = buf.get_f32_le();
12045 __struct.roll_max = buf.get_f32_le();
12046 __struct.pitch_min = buf.get_f32_le();
12047 __struct.pitch_max = buf.get_f32_le();
12048 __struct.yaw_min = buf.get_f32_le();
12049 __struct.yaw_max = buf.get_f32_le();
12050 let tmp = buf.get_u16_le();
12051 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12052 tmp & GimbalDeviceCapFlags::all().bits(),
12053 )
12054 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12055 flag_type: "GimbalDeviceCapFlags",
12056 value: tmp as u32,
12057 })?;
12058 __struct.custom_cap_flags = buf.get_u16_le();
12059 for v in &mut __struct.vendor_name {
12060 let val = buf.get_u8();
12061 *v = val;
12062 }
12063 for v in &mut __struct.model_name {
12064 let val = buf.get_u8();
12065 *v = val;
12066 }
12067 for v in &mut __struct.custom_name {
12068 let val = buf.get_u8();
12069 *v = val;
12070 }
12071 __struct.gimbal_device_id = buf.get_u8();
12072 Ok(__struct)
12073 }
12074 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12075 let mut __tmp = BytesMut::new(bytes);
12076 #[allow(clippy::absurd_extreme_comparisons)]
12077 #[allow(unused_comparisons)]
12078 if __tmp.remaining() < Self::ENCODED_LEN {
12079 panic!(
12080 "buffer is too small (need {} bytes, but got {})",
12081 Self::ENCODED_LEN,
12082 __tmp.remaining(),
12083 )
12084 }
12085 __tmp.put_u64_le(self.uid);
12086 __tmp.put_u32_le(self.time_boot_ms);
12087 __tmp.put_u32_le(self.firmware_version);
12088 __tmp.put_u32_le(self.hardware_version);
12089 __tmp.put_f32_le(self.roll_min);
12090 __tmp.put_f32_le(self.roll_max);
12091 __tmp.put_f32_le(self.pitch_min);
12092 __tmp.put_f32_le(self.pitch_max);
12093 __tmp.put_f32_le(self.yaw_min);
12094 __tmp.put_f32_le(self.yaw_max);
12095 __tmp.put_u16_le(self.cap_flags.bits());
12096 __tmp.put_u16_le(self.custom_cap_flags);
12097 for val in &self.vendor_name {
12098 __tmp.put_u8(*val);
12099 }
12100 for val in &self.model_name {
12101 __tmp.put_u8(*val);
12102 }
12103 for val in &self.custom_name {
12104 __tmp.put_u8(*val);
12105 }
12106 if matches!(version, MavlinkVersion::V2) {
12107 __tmp.put_u8(self.gimbal_device_id);
12108 let len = __tmp.len();
12109 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12110 } else {
12111 __tmp.len()
12112 }
12113 }
12114}
12115#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12116#[doc = ""]
12117#[doc = "ID: 284"]
12118#[derive(Debug, Clone, PartialEq)]
12119#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12121pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12122 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12123 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12124 pub q: [f32; 4],
12125 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12126 pub angular_velocity_x: f32,
12127 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12128 pub angular_velocity_y: f32,
12129 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12130 pub angular_velocity_z: f32,
12131 #[doc = "Low level gimbal flags."]
12132 pub flags: GimbalDeviceFlags,
12133 #[doc = "System ID"]
12134 pub target_system: u8,
12135 #[doc = "Component ID"]
12136 pub target_component: u8,
12137}
12138impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12139 pub const ENCODED_LEN: usize = 32usize;
12140 pub const DEFAULT: Self = Self {
12141 q: [0.0_f32; 4usize],
12142 angular_velocity_x: 0.0_f32,
12143 angular_velocity_y: 0.0_f32,
12144 angular_velocity_z: 0.0_f32,
12145 flags: GimbalDeviceFlags::DEFAULT,
12146 target_system: 0_u8,
12147 target_component: 0_u8,
12148 };
12149 #[cfg(feature = "arbitrary")]
12150 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12151 use arbitrary::{Arbitrary, Unstructured};
12152 let mut buf = [0u8; 1024];
12153 rng.fill_bytes(&mut buf);
12154 let mut unstructured = Unstructured::new(&buf);
12155 Self::arbitrary(&mut unstructured).unwrap_or_default()
12156 }
12157}
12158impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12159 fn default() -> Self {
12160 Self::DEFAULT.clone()
12161 }
12162}
12163impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12164 type Message = MavMessage;
12165 const ID: u32 = 284u32;
12166 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12167 const EXTRA_CRC: u8 = 99u8;
12168 const ENCODED_LEN: usize = 32usize;
12169 fn deser(
12170 _version: MavlinkVersion,
12171 __input: &[u8],
12172 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12173 let avail_len = __input.len();
12174 let mut payload_buf = [0; Self::ENCODED_LEN];
12175 let mut buf = if avail_len < Self::ENCODED_LEN {
12176 payload_buf[0..avail_len].copy_from_slice(__input);
12177 Bytes::new(&payload_buf)
12178 } else {
12179 Bytes::new(__input)
12180 };
12181 let mut __struct = Self::default();
12182 for v in &mut __struct.q {
12183 let val = buf.get_f32_le();
12184 *v = val;
12185 }
12186 __struct.angular_velocity_x = buf.get_f32_le();
12187 __struct.angular_velocity_y = buf.get_f32_le();
12188 __struct.angular_velocity_z = buf.get_f32_le();
12189 let tmp = buf.get_u16_le();
12190 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12191 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12192 flag_type: "GimbalDeviceFlags",
12193 value: tmp as u32,
12194 })?;
12195 __struct.target_system = buf.get_u8();
12196 __struct.target_component = buf.get_u8();
12197 Ok(__struct)
12198 }
12199 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12200 let mut __tmp = BytesMut::new(bytes);
12201 #[allow(clippy::absurd_extreme_comparisons)]
12202 #[allow(unused_comparisons)]
12203 if __tmp.remaining() < Self::ENCODED_LEN {
12204 panic!(
12205 "buffer is too small (need {} bytes, but got {})",
12206 Self::ENCODED_LEN,
12207 __tmp.remaining(),
12208 )
12209 }
12210 for val in &self.q {
12211 __tmp.put_f32_le(*val);
12212 }
12213 __tmp.put_f32_le(self.angular_velocity_x);
12214 __tmp.put_f32_le(self.angular_velocity_y);
12215 __tmp.put_f32_le(self.angular_velocity_z);
12216 __tmp.put_u16_le(self.flags.bits());
12217 __tmp.put_u8(self.target_system);
12218 __tmp.put_u8(self.target_component);
12219 if matches!(version, MavlinkVersion::V2) {
12220 let len = __tmp.len();
12221 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12222 } else {
12223 __tmp.len()
12224 }
12225 }
12226}
12227#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12228#[doc = ""]
12229#[doc = "ID: 280"]
12230#[derive(Debug, Clone, PartialEq)]
12231#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12232#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12233pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12234 #[doc = "Timestamp (time since system boot)."]
12235 pub time_boot_ms: u32,
12236 #[doc = "Bitmap of gimbal capability flags."]
12237 pub cap_flags: GimbalManagerCapFlags,
12238 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12239 pub roll_min: f32,
12240 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12241 pub roll_max: f32,
12242 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12243 pub pitch_min: f32,
12244 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12245 pub pitch_max: f32,
12246 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12247 pub yaw_min: f32,
12248 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12249 pub yaw_max: f32,
12250 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12251 pub gimbal_device_id: u8,
12252}
12253impl GIMBAL_MANAGER_INFORMATION_DATA {
12254 pub const ENCODED_LEN: usize = 33usize;
12255 pub const DEFAULT: Self = Self {
12256 time_boot_ms: 0_u32,
12257 cap_flags: GimbalManagerCapFlags::DEFAULT,
12258 roll_min: 0.0_f32,
12259 roll_max: 0.0_f32,
12260 pitch_min: 0.0_f32,
12261 pitch_max: 0.0_f32,
12262 yaw_min: 0.0_f32,
12263 yaw_max: 0.0_f32,
12264 gimbal_device_id: 0_u8,
12265 };
12266 #[cfg(feature = "arbitrary")]
12267 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12268 use arbitrary::{Arbitrary, Unstructured};
12269 let mut buf = [0u8; 1024];
12270 rng.fill_bytes(&mut buf);
12271 let mut unstructured = Unstructured::new(&buf);
12272 Self::arbitrary(&mut unstructured).unwrap_or_default()
12273 }
12274}
12275impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12276 fn default() -> Self {
12277 Self::DEFAULT.clone()
12278 }
12279}
12280impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12281 type Message = MavMessage;
12282 const ID: u32 = 280u32;
12283 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12284 const EXTRA_CRC: u8 = 70u8;
12285 const ENCODED_LEN: usize = 33usize;
12286 fn deser(
12287 _version: MavlinkVersion,
12288 __input: &[u8],
12289 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12290 let avail_len = __input.len();
12291 let mut payload_buf = [0; Self::ENCODED_LEN];
12292 let mut buf = if avail_len < Self::ENCODED_LEN {
12293 payload_buf[0..avail_len].copy_from_slice(__input);
12294 Bytes::new(&payload_buf)
12295 } else {
12296 Bytes::new(__input)
12297 };
12298 let mut __struct = Self::default();
12299 __struct.time_boot_ms = buf.get_u32_le();
12300 let tmp = buf.get_u32_le();
12301 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12302 tmp & GimbalManagerCapFlags::all().bits(),
12303 )
12304 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12305 flag_type: "GimbalManagerCapFlags",
12306 value: tmp as u32,
12307 })?;
12308 __struct.roll_min = buf.get_f32_le();
12309 __struct.roll_max = buf.get_f32_le();
12310 __struct.pitch_min = buf.get_f32_le();
12311 __struct.pitch_max = buf.get_f32_le();
12312 __struct.yaw_min = buf.get_f32_le();
12313 __struct.yaw_max = buf.get_f32_le();
12314 __struct.gimbal_device_id = buf.get_u8();
12315 Ok(__struct)
12316 }
12317 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12318 let mut __tmp = BytesMut::new(bytes);
12319 #[allow(clippy::absurd_extreme_comparisons)]
12320 #[allow(unused_comparisons)]
12321 if __tmp.remaining() < Self::ENCODED_LEN {
12322 panic!(
12323 "buffer is too small (need {} bytes, but got {})",
12324 Self::ENCODED_LEN,
12325 __tmp.remaining(),
12326 )
12327 }
12328 __tmp.put_u32_le(self.time_boot_ms);
12329 __tmp.put_u32_le(self.cap_flags.bits());
12330 __tmp.put_f32_le(self.roll_min);
12331 __tmp.put_f32_le(self.roll_max);
12332 __tmp.put_f32_le(self.pitch_min);
12333 __tmp.put_f32_le(self.pitch_max);
12334 __tmp.put_f32_le(self.yaw_min);
12335 __tmp.put_f32_le(self.yaw_max);
12336 __tmp.put_u8(self.gimbal_device_id);
12337 if matches!(version, MavlinkVersion::V2) {
12338 let len = __tmp.len();
12339 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12340 } else {
12341 __tmp.len()
12342 }
12343 }
12344}
12345#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12346#[doc = ""]
12347#[doc = "ID: 282"]
12348#[derive(Debug, Clone, PartialEq)]
12349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12350#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12351pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12352 #[doc = "High level gimbal manager flags to use."]
12353 pub flags: GimbalManagerFlags,
12354 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
12355 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12356 pub q: [f32; 4],
12357 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
12358 pub angular_velocity_x: f32,
12359 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
12360 pub angular_velocity_y: f32,
12361 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
12362 pub angular_velocity_z: f32,
12363 #[doc = "System ID"]
12364 pub target_system: u8,
12365 #[doc = "Component ID"]
12366 pub target_component: u8,
12367 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12368 pub gimbal_device_id: u8,
12369}
12370impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12371 pub const ENCODED_LEN: usize = 35usize;
12372 pub const DEFAULT: Self = Self {
12373 flags: GimbalManagerFlags::DEFAULT,
12374 q: [0.0_f32; 4usize],
12375 angular_velocity_x: 0.0_f32,
12376 angular_velocity_y: 0.0_f32,
12377 angular_velocity_z: 0.0_f32,
12378 target_system: 0_u8,
12379 target_component: 0_u8,
12380 gimbal_device_id: 0_u8,
12381 };
12382 #[cfg(feature = "arbitrary")]
12383 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12384 use arbitrary::{Arbitrary, Unstructured};
12385 let mut buf = [0u8; 1024];
12386 rng.fill_bytes(&mut buf);
12387 let mut unstructured = Unstructured::new(&buf);
12388 Self::arbitrary(&mut unstructured).unwrap_or_default()
12389 }
12390}
12391impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12392 fn default() -> Self {
12393 Self::DEFAULT.clone()
12394 }
12395}
12396impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12397 type Message = MavMessage;
12398 const ID: u32 = 282u32;
12399 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
12400 const EXTRA_CRC: u8 = 123u8;
12401 const ENCODED_LEN: usize = 35usize;
12402 fn deser(
12403 _version: MavlinkVersion,
12404 __input: &[u8],
12405 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12406 let avail_len = __input.len();
12407 let mut payload_buf = [0; Self::ENCODED_LEN];
12408 let mut buf = if avail_len < Self::ENCODED_LEN {
12409 payload_buf[0..avail_len].copy_from_slice(__input);
12410 Bytes::new(&payload_buf)
12411 } else {
12412 Bytes::new(__input)
12413 };
12414 let mut __struct = Self::default();
12415 let tmp = buf.get_u32_le();
12416 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12417 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12418 flag_type: "GimbalManagerFlags",
12419 value: tmp as u32,
12420 })?;
12421 for v in &mut __struct.q {
12422 let val = buf.get_f32_le();
12423 *v = val;
12424 }
12425 __struct.angular_velocity_x = buf.get_f32_le();
12426 __struct.angular_velocity_y = buf.get_f32_le();
12427 __struct.angular_velocity_z = buf.get_f32_le();
12428 __struct.target_system = buf.get_u8();
12429 __struct.target_component = buf.get_u8();
12430 __struct.gimbal_device_id = buf.get_u8();
12431 Ok(__struct)
12432 }
12433 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12434 let mut __tmp = BytesMut::new(bytes);
12435 #[allow(clippy::absurd_extreme_comparisons)]
12436 #[allow(unused_comparisons)]
12437 if __tmp.remaining() < Self::ENCODED_LEN {
12438 panic!(
12439 "buffer is too small (need {} bytes, but got {})",
12440 Self::ENCODED_LEN,
12441 __tmp.remaining(),
12442 )
12443 }
12444 __tmp.put_u32_le(self.flags.bits());
12445 for val in &self.q {
12446 __tmp.put_f32_le(*val);
12447 }
12448 __tmp.put_f32_le(self.angular_velocity_x);
12449 __tmp.put_f32_le(self.angular_velocity_y);
12450 __tmp.put_f32_le(self.angular_velocity_z);
12451 __tmp.put_u8(self.target_system);
12452 __tmp.put_u8(self.target_component);
12453 __tmp.put_u8(self.gimbal_device_id);
12454 if matches!(version, MavlinkVersion::V2) {
12455 let len = __tmp.len();
12456 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12457 } else {
12458 __tmp.len()
12459 }
12460 }
12461}
12462#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12463#[doc = ""]
12464#[doc = "ID: 288"]
12465#[derive(Debug, Clone, PartialEq)]
12466#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12467#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12468pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12469 #[doc = "High level gimbal manager flags."]
12470 pub flags: GimbalManagerFlags,
12471 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12472 pub pitch: f32,
12473 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12474 pub yaw: f32,
12475 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12476 pub pitch_rate: f32,
12477 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12478 pub yaw_rate: f32,
12479 #[doc = "System ID"]
12480 pub target_system: u8,
12481 #[doc = "Component ID"]
12482 pub target_component: u8,
12483 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12484 pub gimbal_device_id: u8,
12485}
12486impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12487 pub const ENCODED_LEN: usize = 23usize;
12488 pub const DEFAULT: Self = Self {
12489 flags: GimbalManagerFlags::DEFAULT,
12490 pitch: 0.0_f32,
12491 yaw: 0.0_f32,
12492 pitch_rate: 0.0_f32,
12493 yaw_rate: 0.0_f32,
12494 target_system: 0_u8,
12495 target_component: 0_u8,
12496 gimbal_device_id: 0_u8,
12497 };
12498 #[cfg(feature = "arbitrary")]
12499 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12500 use arbitrary::{Arbitrary, Unstructured};
12501 let mut buf = [0u8; 1024];
12502 rng.fill_bytes(&mut buf);
12503 let mut unstructured = Unstructured::new(&buf);
12504 Self::arbitrary(&mut unstructured).unwrap_or_default()
12505 }
12506}
12507impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12508 fn default() -> Self {
12509 Self::DEFAULT.clone()
12510 }
12511}
12512impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12513 type Message = MavMessage;
12514 const ID: u32 = 288u32;
12515 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
12516 const EXTRA_CRC: u8 = 20u8;
12517 const ENCODED_LEN: usize = 23usize;
12518 fn deser(
12519 _version: MavlinkVersion,
12520 __input: &[u8],
12521 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12522 let avail_len = __input.len();
12523 let mut payload_buf = [0; Self::ENCODED_LEN];
12524 let mut buf = if avail_len < Self::ENCODED_LEN {
12525 payload_buf[0..avail_len].copy_from_slice(__input);
12526 Bytes::new(&payload_buf)
12527 } else {
12528 Bytes::new(__input)
12529 };
12530 let mut __struct = Self::default();
12531 let tmp = buf.get_u32_le();
12532 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12533 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12534 flag_type: "GimbalManagerFlags",
12535 value: tmp as u32,
12536 })?;
12537 __struct.pitch = buf.get_f32_le();
12538 __struct.yaw = buf.get_f32_le();
12539 __struct.pitch_rate = buf.get_f32_le();
12540 __struct.yaw_rate = buf.get_f32_le();
12541 __struct.target_system = buf.get_u8();
12542 __struct.target_component = buf.get_u8();
12543 __struct.gimbal_device_id = buf.get_u8();
12544 Ok(__struct)
12545 }
12546 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12547 let mut __tmp = BytesMut::new(bytes);
12548 #[allow(clippy::absurd_extreme_comparisons)]
12549 #[allow(unused_comparisons)]
12550 if __tmp.remaining() < Self::ENCODED_LEN {
12551 panic!(
12552 "buffer is too small (need {} bytes, but got {})",
12553 Self::ENCODED_LEN,
12554 __tmp.remaining(),
12555 )
12556 }
12557 __tmp.put_u32_le(self.flags.bits());
12558 __tmp.put_f32_le(self.pitch);
12559 __tmp.put_f32_le(self.yaw);
12560 __tmp.put_f32_le(self.pitch_rate);
12561 __tmp.put_f32_le(self.yaw_rate);
12562 __tmp.put_u8(self.target_system);
12563 __tmp.put_u8(self.target_component);
12564 __tmp.put_u8(self.gimbal_device_id);
12565 if matches!(version, MavlinkVersion::V2) {
12566 let len = __tmp.len();
12567 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12568 } else {
12569 __tmp.len()
12570 }
12571 }
12572}
12573#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
12574#[doc = ""]
12575#[doc = "ID: 287"]
12576#[derive(Debug, Clone, PartialEq)]
12577#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12578#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12579pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12580 #[doc = "High level gimbal manager flags to use."]
12581 pub flags: GimbalManagerFlags,
12582 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
12583 pub pitch: f32,
12584 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
12585 pub yaw: f32,
12586 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
12587 pub pitch_rate: f32,
12588 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
12589 pub yaw_rate: f32,
12590 #[doc = "System ID"]
12591 pub target_system: u8,
12592 #[doc = "Component ID"]
12593 pub target_component: u8,
12594 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12595 pub gimbal_device_id: u8,
12596}
12597impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12598 pub const ENCODED_LEN: usize = 23usize;
12599 pub const DEFAULT: Self = Self {
12600 flags: GimbalManagerFlags::DEFAULT,
12601 pitch: 0.0_f32,
12602 yaw: 0.0_f32,
12603 pitch_rate: 0.0_f32,
12604 yaw_rate: 0.0_f32,
12605 target_system: 0_u8,
12606 target_component: 0_u8,
12607 gimbal_device_id: 0_u8,
12608 };
12609 #[cfg(feature = "arbitrary")]
12610 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12611 use arbitrary::{Arbitrary, Unstructured};
12612 let mut buf = [0u8; 1024];
12613 rng.fill_bytes(&mut buf);
12614 let mut unstructured = Unstructured::new(&buf);
12615 Self::arbitrary(&mut unstructured).unwrap_or_default()
12616 }
12617}
12618impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12619 fn default() -> Self {
12620 Self::DEFAULT.clone()
12621 }
12622}
12623impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12624 type Message = MavMessage;
12625 const ID: u32 = 287u32;
12626 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
12627 const EXTRA_CRC: u8 = 1u8;
12628 const ENCODED_LEN: usize = 23usize;
12629 fn deser(
12630 _version: MavlinkVersion,
12631 __input: &[u8],
12632 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12633 let avail_len = __input.len();
12634 let mut payload_buf = [0; Self::ENCODED_LEN];
12635 let mut buf = if avail_len < Self::ENCODED_LEN {
12636 payload_buf[0..avail_len].copy_from_slice(__input);
12637 Bytes::new(&payload_buf)
12638 } else {
12639 Bytes::new(__input)
12640 };
12641 let mut __struct = Self::default();
12642 let tmp = buf.get_u32_le();
12643 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12644 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12645 flag_type: "GimbalManagerFlags",
12646 value: tmp as u32,
12647 })?;
12648 __struct.pitch = buf.get_f32_le();
12649 __struct.yaw = buf.get_f32_le();
12650 __struct.pitch_rate = buf.get_f32_le();
12651 __struct.yaw_rate = buf.get_f32_le();
12652 __struct.target_system = buf.get_u8();
12653 __struct.target_component = buf.get_u8();
12654 __struct.gimbal_device_id = buf.get_u8();
12655 Ok(__struct)
12656 }
12657 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12658 let mut __tmp = BytesMut::new(bytes);
12659 #[allow(clippy::absurd_extreme_comparisons)]
12660 #[allow(unused_comparisons)]
12661 if __tmp.remaining() < Self::ENCODED_LEN {
12662 panic!(
12663 "buffer is too small (need {} bytes, but got {})",
12664 Self::ENCODED_LEN,
12665 __tmp.remaining(),
12666 )
12667 }
12668 __tmp.put_u32_le(self.flags.bits());
12669 __tmp.put_f32_le(self.pitch);
12670 __tmp.put_f32_le(self.yaw);
12671 __tmp.put_f32_le(self.pitch_rate);
12672 __tmp.put_f32_le(self.yaw_rate);
12673 __tmp.put_u8(self.target_system);
12674 __tmp.put_u8(self.target_component);
12675 __tmp.put_u8(self.gimbal_device_id);
12676 if matches!(version, MavlinkVersion::V2) {
12677 let len = __tmp.len();
12678 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12679 } else {
12680 __tmp.len()
12681 }
12682 }
12683}
12684#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
12685#[doc = ""]
12686#[doc = "ID: 281"]
12687#[derive(Debug, Clone, PartialEq)]
12688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12689#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12690pub struct GIMBAL_MANAGER_STATUS_DATA {
12691 #[doc = "Timestamp (time since system boot)."]
12692 pub time_boot_ms: u32,
12693 #[doc = "High level gimbal manager flags currently applied."]
12694 pub flags: GimbalManagerFlags,
12695 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12696 pub gimbal_device_id: u8,
12697 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
12698 pub primary_control_sysid: u8,
12699 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
12700 pub primary_control_compid: u8,
12701 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
12702 pub secondary_control_sysid: u8,
12703 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
12704 pub secondary_control_compid: u8,
12705}
12706impl GIMBAL_MANAGER_STATUS_DATA {
12707 pub const ENCODED_LEN: usize = 13usize;
12708 pub const DEFAULT: Self = Self {
12709 time_boot_ms: 0_u32,
12710 flags: GimbalManagerFlags::DEFAULT,
12711 gimbal_device_id: 0_u8,
12712 primary_control_sysid: 0_u8,
12713 primary_control_compid: 0_u8,
12714 secondary_control_sysid: 0_u8,
12715 secondary_control_compid: 0_u8,
12716 };
12717 #[cfg(feature = "arbitrary")]
12718 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12719 use arbitrary::{Arbitrary, Unstructured};
12720 let mut buf = [0u8; 1024];
12721 rng.fill_bytes(&mut buf);
12722 let mut unstructured = Unstructured::new(&buf);
12723 Self::arbitrary(&mut unstructured).unwrap_or_default()
12724 }
12725}
12726impl Default for GIMBAL_MANAGER_STATUS_DATA {
12727 fn default() -> Self {
12728 Self::DEFAULT.clone()
12729 }
12730}
12731impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
12732 type Message = MavMessage;
12733 const ID: u32 = 281u32;
12734 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
12735 const EXTRA_CRC: u8 = 48u8;
12736 const ENCODED_LEN: usize = 13usize;
12737 fn deser(
12738 _version: MavlinkVersion,
12739 __input: &[u8],
12740 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12741 let avail_len = __input.len();
12742 let mut payload_buf = [0; Self::ENCODED_LEN];
12743 let mut buf = if avail_len < Self::ENCODED_LEN {
12744 payload_buf[0..avail_len].copy_from_slice(__input);
12745 Bytes::new(&payload_buf)
12746 } else {
12747 Bytes::new(__input)
12748 };
12749 let mut __struct = Self::default();
12750 __struct.time_boot_ms = buf.get_u32_le();
12751 let tmp = buf.get_u32_le();
12752 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12753 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12754 flag_type: "GimbalManagerFlags",
12755 value: tmp as u32,
12756 })?;
12757 __struct.gimbal_device_id = buf.get_u8();
12758 __struct.primary_control_sysid = buf.get_u8();
12759 __struct.primary_control_compid = buf.get_u8();
12760 __struct.secondary_control_sysid = buf.get_u8();
12761 __struct.secondary_control_compid = buf.get_u8();
12762 Ok(__struct)
12763 }
12764 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12765 let mut __tmp = BytesMut::new(bytes);
12766 #[allow(clippy::absurd_extreme_comparisons)]
12767 #[allow(unused_comparisons)]
12768 if __tmp.remaining() < Self::ENCODED_LEN {
12769 panic!(
12770 "buffer is too small (need {} bytes, but got {})",
12771 Self::ENCODED_LEN,
12772 __tmp.remaining(),
12773 )
12774 }
12775 __tmp.put_u32_le(self.time_boot_ms);
12776 __tmp.put_u32_le(self.flags.bits());
12777 __tmp.put_u8(self.gimbal_device_id);
12778 __tmp.put_u8(self.primary_control_sysid);
12779 __tmp.put_u8(self.primary_control_compid);
12780 __tmp.put_u8(self.secondary_control_sysid);
12781 __tmp.put_u8(self.secondary_control_compid);
12782 if matches!(version, MavlinkVersion::V2) {
12783 let len = __tmp.len();
12784 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12785 } else {
12786 __tmp.len()
12787 }
12788 }
12789}
12790#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
12791#[doc = ""]
12792#[doc = "ID: 33"]
12793#[derive(Debug, Clone, PartialEq)]
12794#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12796pub struct GLOBAL_POSITION_INT_DATA {
12797 #[doc = "Timestamp (time since system boot)."]
12798 pub time_boot_ms: u32,
12799 #[doc = "Latitude, expressed"]
12800 pub lat: i32,
12801 #[doc = "Longitude, expressed"]
12802 pub lon: i32,
12803 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
12804 pub alt: i32,
12805 #[doc = "Altitude above home"]
12806 pub relative_alt: i32,
12807 #[doc = "Ground X Speed (Latitude, positive north)"]
12808 pub vx: i16,
12809 #[doc = "Ground Y Speed (Longitude, positive east)"]
12810 pub vy: i16,
12811 #[doc = "Ground Z Speed (Altitude, positive down)"]
12812 pub vz: i16,
12813 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
12814 pub hdg: u16,
12815}
12816impl GLOBAL_POSITION_INT_DATA {
12817 pub const ENCODED_LEN: usize = 28usize;
12818 pub const DEFAULT: Self = Self {
12819 time_boot_ms: 0_u32,
12820 lat: 0_i32,
12821 lon: 0_i32,
12822 alt: 0_i32,
12823 relative_alt: 0_i32,
12824 vx: 0_i16,
12825 vy: 0_i16,
12826 vz: 0_i16,
12827 hdg: 0_u16,
12828 };
12829 #[cfg(feature = "arbitrary")]
12830 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12831 use arbitrary::{Arbitrary, Unstructured};
12832 let mut buf = [0u8; 1024];
12833 rng.fill_bytes(&mut buf);
12834 let mut unstructured = Unstructured::new(&buf);
12835 Self::arbitrary(&mut unstructured).unwrap_or_default()
12836 }
12837}
12838impl Default for GLOBAL_POSITION_INT_DATA {
12839 fn default() -> Self {
12840 Self::DEFAULT.clone()
12841 }
12842}
12843impl MessageData for GLOBAL_POSITION_INT_DATA {
12844 type Message = MavMessage;
12845 const ID: u32 = 33u32;
12846 const NAME: &'static str = "GLOBAL_POSITION_INT";
12847 const EXTRA_CRC: u8 = 104u8;
12848 const ENCODED_LEN: usize = 28usize;
12849 fn deser(
12850 _version: MavlinkVersion,
12851 __input: &[u8],
12852 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12853 let avail_len = __input.len();
12854 let mut payload_buf = [0; Self::ENCODED_LEN];
12855 let mut buf = if avail_len < Self::ENCODED_LEN {
12856 payload_buf[0..avail_len].copy_from_slice(__input);
12857 Bytes::new(&payload_buf)
12858 } else {
12859 Bytes::new(__input)
12860 };
12861 let mut __struct = Self::default();
12862 __struct.time_boot_ms = buf.get_u32_le();
12863 __struct.lat = buf.get_i32_le();
12864 __struct.lon = buf.get_i32_le();
12865 __struct.alt = buf.get_i32_le();
12866 __struct.relative_alt = buf.get_i32_le();
12867 __struct.vx = buf.get_i16_le();
12868 __struct.vy = buf.get_i16_le();
12869 __struct.vz = buf.get_i16_le();
12870 __struct.hdg = buf.get_u16_le();
12871 Ok(__struct)
12872 }
12873 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12874 let mut __tmp = BytesMut::new(bytes);
12875 #[allow(clippy::absurd_extreme_comparisons)]
12876 #[allow(unused_comparisons)]
12877 if __tmp.remaining() < Self::ENCODED_LEN {
12878 panic!(
12879 "buffer is too small (need {} bytes, but got {})",
12880 Self::ENCODED_LEN,
12881 __tmp.remaining(),
12882 )
12883 }
12884 __tmp.put_u32_le(self.time_boot_ms);
12885 __tmp.put_i32_le(self.lat);
12886 __tmp.put_i32_le(self.lon);
12887 __tmp.put_i32_le(self.alt);
12888 __tmp.put_i32_le(self.relative_alt);
12889 __tmp.put_i16_le(self.vx);
12890 __tmp.put_i16_le(self.vy);
12891 __tmp.put_i16_le(self.vz);
12892 __tmp.put_u16_le(self.hdg);
12893 if matches!(version, MavlinkVersion::V2) {
12894 let len = __tmp.len();
12895 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12896 } else {
12897 __tmp.len()
12898 }
12899 }
12900}
12901#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
12902#[doc = ""]
12903#[doc = "ID: 63"]
12904#[derive(Debug, Clone, PartialEq)]
12905#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12906#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12907pub struct GLOBAL_POSITION_INT_COV_DATA {
12908 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
12909 pub time_usec: u64,
12910 #[doc = "Latitude"]
12911 pub lat: i32,
12912 #[doc = "Longitude"]
12913 pub lon: i32,
12914 #[doc = "Altitude in meters above MSL"]
12915 pub alt: i32,
12916 #[doc = "Altitude above ground"]
12917 pub relative_alt: i32,
12918 #[doc = "Ground X Speed (Latitude)"]
12919 pub vx: f32,
12920 #[doc = "Ground Y Speed (Longitude)"]
12921 pub vy: f32,
12922 #[doc = "Ground Z Speed (Altitude)"]
12923 pub vz: f32,
12924 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
12925 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12926 pub covariance: [f32; 36],
12927 #[doc = "Class id of the estimator this estimate originated from."]
12928 pub estimator_type: MavEstimatorType,
12929}
12930impl GLOBAL_POSITION_INT_COV_DATA {
12931 pub const ENCODED_LEN: usize = 181usize;
12932 pub const DEFAULT: Self = Self {
12933 time_usec: 0_u64,
12934 lat: 0_i32,
12935 lon: 0_i32,
12936 alt: 0_i32,
12937 relative_alt: 0_i32,
12938 vx: 0.0_f32,
12939 vy: 0.0_f32,
12940 vz: 0.0_f32,
12941 covariance: [0.0_f32; 36usize],
12942 estimator_type: MavEstimatorType::DEFAULT,
12943 };
12944 #[cfg(feature = "arbitrary")]
12945 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12946 use arbitrary::{Arbitrary, Unstructured};
12947 let mut buf = [0u8; 1024];
12948 rng.fill_bytes(&mut buf);
12949 let mut unstructured = Unstructured::new(&buf);
12950 Self::arbitrary(&mut unstructured).unwrap_or_default()
12951 }
12952}
12953impl Default for GLOBAL_POSITION_INT_COV_DATA {
12954 fn default() -> Self {
12955 Self::DEFAULT.clone()
12956 }
12957}
12958impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
12959 type Message = MavMessage;
12960 const ID: u32 = 63u32;
12961 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
12962 const EXTRA_CRC: u8 = 119u8;
12963 const ENCODED_LEN: usize = 181usize;
12964 fn deser(
12965 _version: MavlinkVersion,
12966 __input: &[u8],
12967 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12968 let avail_len = __input.len();
12969 let mut payload_buf = [0; Self::ENCODED_LEN];
12970 let mut buf = if avail_len < Self::ENCODED_LEN {
12971 payload_buf[0..avail_len].copy_from_slice(__input);
12972 Bytes::new(&payload_buf)
12973 } else {
12974 Bytes::new(__input)
12975 };
12976 let mut __struct = Self::default();
12977 __struct.time_usec = buf.get_u64_le();
12978 __struct.lat = buf.get_i32_le();
12979 __struct.lon = buf.get_i32_le();
12980 __struct.alt = buf.get_i32_le();
12981 __struct.relative_alt = buf.get_i32_le();
12982 __struct.vx = buf.get_f32_le();
12983 __struct.vy = buf.get_f32_le();
12984 __struct.vz = buf.get_f32_le();
12985 for v in &mut __struct.covariance {
12986 let val = buf.get_f32_le();
12987 *v = val;
12988 }
12989 let tmp = buf.get_u8();
12990 __struct.estimator_type =
12991 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12992 enum_type: "MavEstimatorType",
12993 value: tmp as u32,
12994 })?;
12995 Ok(__struct)
12996 }
12997 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12998 let mut __tmp = BytesMut::new(bytes);
12999 #[allow(clippy::absurd_extreme_comparisons)]
13000 #[allow(unused_comparisons)]
13001 if __tmp.remaining() < Self::ENCODED_LEN {
13002 panic!(
13003 "buffer is too small (need {} bytes, but got {})",
13004 Self::ENCODED_LEN,
13005 __tmp.remaining(),
13006 )
13007 }
13008 __tmp.put_u64_le(self.time_usec);
13009 __tmp.put_i32_le(self.lat);
13010 __tmp.put_i32_le(self.lon);
13011 __tmp.put_i32_le(self.alt);
13012 __tmp.put_i32_le(self.relative_alt);
13013 __tmp.put_f32_le(self.vx);
13014 __tmp.put_f32_le(self.vy);
13015 __tmp.put_f32_le(self.vz);
13016 for val in &self.covariance {
13017 __tmp.put_f32_le(*val);
13018 }
13019 __tmp.put_u8(self.estimator_type as u8);
13020 if matches!(version, MavlinkVersion::V2) {
13021 let len = __tmp.len();
13022 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13023 } else {
13024 __tmp.len()
13025 }
13026 }
13027}
13028#[doc = "Global position/attitude estimate from a vision source."]
13029#[doc = ""]
13030#[doc = "ID: 101"]
13031#[derive(Debug, Clone, PartialEq)]
13032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13034pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13035 #[doc = "Timestamp (UNIX time or since system boot)"]
13036 pub usec: u64,
13037 #[doc = "Global X position"]
13038 pub x: f32,
13039 #[doc = "Global Y position"]
13040 pub y: f32,
13041 #[doc = "Global Z position"]
13042 pub z: f32,
13043 #[doc = "Roll angle"]
13044 pub roll: f32,
13045 #[doc = "Pitch angle"]
13046 pub pitch: f32,
13047 #[doc = "Yaw angle"]
13048 pub yaw: f32,
13049 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13050 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13051 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13052 pub covariance: [f32; 21],
13053 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13054 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13055 pub reset_counter: u8,
13056}
13057impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13058 pub const ENCODED_LEN: usize = 117usize;
13059 pub const DEFAULT: Self = Self {
13060 usec: 0_u64,
13061 x: 0.0_f32,
13062 y: 0.0_f32,
13063 z: 0.0_f32,
13064 roll: 0.0_f32,
13065 pitch: 0.0_f32,
13066 yaw: 0.0_f32,
13067 covariance: [0.0_f32; 21usize],
13068 reset_counter: 0_u8,
13069 };
13070 #[cfg(feature = "arbitrary")]
13071 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13072 use arbitrary::{Arbitrary, Unstructured};
13073 let mut buf = [0u8; 1024];
13074 rng.fill_bytes(&mut buf);
13075 let mut unstructured = Unstructured::new(&buf);
13076 Self::arbitrary(&mut unstructured).unwrap_or_default()
13077 }
13078}
13079impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13080 fn default() -> Self {
13081 Self::DEFAULT.clone()
13082 }
13083}
13084impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13085 type Message = MavMessage;
13086 const ID: u32 = 101u32;
13087 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13088 const EXTRA_CRC: u8 = 102u8;
13089 const ENCODED_LEN: usize = 117usize;
13090 fn deser(
13091 _version: MavlinkVersion,
13092 __input: &[u8],
13093 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13094 let avail_len = __input.len();
13095 let mut payload_buf = [0; Self::ENCODED_LEN];
13096 let mut buf = if avail_len < Self::ENCODED_LEN {
13097 payload_buf[0..avail_len].copy_from_slice(__input);
13098 Bytes::new(&payload_buf)
13099 } else {
13100 Bytes::new(__input)
13101 };
13102 let mut __struct = Self::default();
13103 __struct.usec = buf.get_u64_le();
13104 __struct.x = buf.get_f32_le();
13105 __struct.y = buf.get_f32_le();
13106 __struct.z = buf.get_f32_le();
13107 __struct.roll = buf.get_f32_le();
13108 __struct.pitch = buf.get_f32_le();
13109 __struct.yaw = buf.get_f32_le();
13110 for v in &mut __struct.covariance {
13111 let val = buf.get_f32_le();
13112 *v = val;
13113 }
13114 __struct.reset_counter = buf.get_u8();
13115 Ok(__struct)
13116 }
13117 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13118 let mut __tmp = BytesMut::new(bytes);
13119 #[allow(clippy::absurd_extreme_comparisons)]
13120 #[allow(unused_comparisons)]
13121 if __tmp.remaining() < Self::ENCODED_LEN {
13122 panic!(
13123 "buffer is too small (need {} bytes, but got {})",
13124 Self::ENCODED_LEN,
13125 __tmp.remaining(),
13126 )
13127 }
13128 __tmp.put_u64_le(self.usec);
13129 __tmp.put_f32_le(self.x);
13130 __tmp.put_f32_le(self.y);
13131 __tmp.put_f32_le(self.z);
13132 __tmp.put_f32_le(self.roll);
13133 __tmp.put_f32_le(self.pitch);
13134 __tmp.put_f32_le(self.yaw);
13135 if matches!(version, MavlinkVersion::V2) {
13136 for val in &self.covariance {
13137 __tmp.put_f32_le(*val);
13138 }
13139 __tmp.put_u8(self.reset_counter);
13140 let len = __tmp.len();
13141 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13142 } else {
13143 __tmp.len()
13144 }
13145 }
13146}
13147#[doc = "Second GPS data."]
13148#[doc = ""]
13149#[doc = "ID: 124"]
13150#[derive(Debug, Clone, PartialEq)]
13151#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13152#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13153pub struct GPS2_RAW_DATA {
13154 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13155 pub time_usec: u64,
13156 #[doc = "Latitude (WGS84)"]
13157 pub lat: i32,
13158 #[doc = "Longitude (WGS84)"]
13159 pub lon: i32,
13160 #[doc = "Altitude (MSL). Positive for up."]
13161 pub alt: i32,
13162 #[doc = "Age of DGPS info"]
13163 pub dgps_age: u32,
13164 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13165 pub eph: u16,
13166 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13167 pub epv: u16,
13168 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13169 pub vel: u16,
13170 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13171 pub cog: u16,
13172 #[doc = "GPS fix type."]
13173 pub fix_type: GpsFixType,
13174 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13175 pub satellites_visible: u8,
13176 #[doc = "Number of DGPS satellites"]
13177 pub dgps_numch: u8,
13178 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13179 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13180 pub yaw: u16,
13181 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13182 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13183 pub alt_ellipsoid: i32,
13184 #[doc = "Position uncertainty."]
13185 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13186 pub h_acc: u32,
13187 #[doc = "Altitude uncertainty."]
13188 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13189 pub v_acc: u32,
13190 #[doc = "Speed uncertainty."]
13191 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13192 pub vel_acc: u32,
13193 #[doc = "Heading / track uncertainty"]
13194 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13195 pub hdg_acc: u32,
13196}
13197impl GPS2_RAW_DATA {
13198 pub const ENCODED_LEN: usize = 57usize;
13199 pub const DEFAULT: Self = Self {
13200 time_usec: 0_u64,
13201 lat: 0_i32,
13202 lon: 0_i32,
13203 alt: 0_i32,
13204 dgps_age: 0_u32,
13205 eph: 0_u16,
13206 epv: 0_u16,
13207 vel: 0_u16,
13208 cog: 0_u16,
13209 fix_type: GpsFixType::DEFAULT,
13210 satellites_visible: 0_u8,
13211 dgps_numch: 0_u8,
13212 yaw: 0_u16,
13213 alt_ellipsoid: 0_i32,
13214 h_acc: 0_u32,
13215 v_acc: 0_u32,
13216 vel_acc: 0_u32,
13217 hdg_acc: 0_u32,
13218 };
13219 #[cfg(feature = "arbitrary")]
13220 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13221 use arbitrary::{Arbitrary, Unstructured};
13222 let mut buf = [0u8; 1024];
13223 rng.fill_bytes(&mut buf);
13224 let mut unstructured = Unstructured::new(&buf);
13225 Self::arbitrary(&mut unstructured).unwrap_or_default()
13226 }
13227}
13228impl Default for GPS2_RAW_DATA {
13229 fn default() -> Self {
13230 Self::DEFAULT.clone()
13231 }
13232}
13233impl MessageData for GPS2_RAW_DATA {
13234 type Message = MavMessage;
13235 const ID: u32 = 124u32;
13236 const NAME: &'static str = "GPS2_RAW";
13237 const EXTRA_CRC: u8 = 87u8;
13238 const ENCODED_LEN: usize = 57usize;
13239 fn deser(
13240 _version: MavlinkVersion,
13241 __input: &[u8],
13242 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13243 let avail_len = __input.len();
13244 let mut payload_buf = [0; Self::ENCODED_LEN];
13245 let mut buf = if avail_len < Self::ENCODED_LEN {
13246 payload_buf[0..avail_len].copy_from_slice(__input);
13247 Bytes::new(&payload_buf)
13248 } else {
13249 Bytes::new(__input)
13250 };
13251 let mut __struct = Self::default();
13252 __struct.time_usec = buf.get_u64_le();
13253 __struct.lat = buf.get_i32_le();
13254 __struct.lon = buf.get_i32_le();
13255 __struct.alt = buf.get_i32_le();
13256 __struct.dgps_age = buf.get_u32_le();
13257 __struct.eph = buf.get_u16_le();
13258 __struct.epv = buf.get_u16_le();
13259 __struct.vel = buf.get_u16_le();
13260 __struct.cog = buf.get_u16_le();
13261 let tmp = buf.get_u8();
13262 __struct.fix_type =
13263 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13264 enum_type: "GpsFixType",
13265 value: tmp as u32,
13266 })?;
13267 __struct.satellites_visible = buf.get_u8();
13268 __struct.dgps_numch = buf.get_u8();
13269 __struct.yaw = buf.get_u16_le();
13270 __struct.alt_ellipsoid = buf.get_i32_le();
13271 __struct.h_acc = buf.get_u32_le();
13272 __struct.v_acc = buf.get_u32_le();
13273 __struct.vel_acc = buf.get_u32_le();
13274 __struct.hdg_acc = buf.get_u32_le();
13275 Ok(__struct)
13276 }
13277 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13278 let mut __tmp = BytesMut::new(bytes);
13279 #[allow(clippy::absurd_extreme_comparisons)]
13280 #[allow(unused_comparisons)]
13281 if __tmp.remaining() < Self::ENCODED_LEN {
13282 panic!(
13283 "buffer is too small (need {} bytes, but got {})",
13284 Self::ENCODED_LEN,
13285 __tmp.remaining(),
13286 )
13287 }
13288 __tmp.put_u64_le(self.time_usec);
13289 __tmp.put_i32_le(self.lat);
13290 __tmp.put_i32_le(self.lon);
13291 __tmp.put_i32_le(self.alt);
13292 __tmp.put_u32_le(self.dgps_age);
13293 __tmp.put_u16_le(self.eph);
13294 __tmp.put_u16_le(self.epv);
13295 __tmp.put_u16_le(self.vel);
13296 __tmp.put_u16_le(self.cog);
13297 __tmp.put_u8(self.fix_type as u8);
13298 __tmp.put_u8(self.satellites_visible);
13299 __tmp.put_u8(self.dgps_numch);
13300 if matches!(version, MavlinkVersion::V2) {
13301 __tmp.put_u16_le(self.yaw);
13302 __tmp.put_i32_le(self.alt_ellipsoid);
13303 __tmp.put_u32_le(self.h_acc);
13304 __tmp.put_u32_le(self.v_acc);
13305 __tmp.put_u32_le(self.vel_acc);
13306 __tmp.put_u32_le(self.hdg_acc);
13307 let len = __tmp.len();
13308 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13309 } else {
13310 __tmp.len()
13311 }
13312 }
13313}
13314#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13315#[doc = ""]
13316#[doc = "ID: 128"]
13317#[derive(Debug, Clone, PartialEq)]
13318#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13319#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13320pub struct GPS2_RTK_DATA {
13321 #[doc = "Time since boot of last baseline message received."]
13322 pub time_last_baseline_ms: u32,
13323 #[doc = "GPS Time of Week of last baseline"]
13324 pub tow: u32,
13325 #[doc = "Current baseline in ECEF x or NED north component."]
13326 pub baseline_a_mm: i32,
13327 #[doc = "Current baseline in ECEF y or NED east component."]
13328 pub baseline_b_mm: i32,
13329 #[doc = "Current baseline in ECEF z or NED down component."]
13330 pub baseline_c_mm: i32,
13331 #[doc = "Current estimate of baseline accuracy."]
13332 pub accuracy: u32,
13333 #[doc = "Current number of integer ambiguity hypotheses."]
13334 pub iar_num_hypotheses: i32,
13335 #[doc = "GPS Week Number of last baseline"]
13336 pub wn: u16,
13337 #[doc = "Identification of connected RTK receiver."]
13338 pub rtk_receiver_id: u8,
13339 #[doc = "GPS-specific health report for RTK data."]
13340 pub rtk_health: u8,
13341 #[doc = "Rate of baseline messages being received by GPS"]
13342 pub rtk_rate: u8,
13343 #[doc = "Current number of sats used for RTK calculation."]
13344 pub nsats: u8,
13345 #[doc = "Coordinate system of baseline"]
13346 pub baseline_coords_type: RtkBaselineCoordinateSystem,
13347}
13348impl GPS2_RTK_DATA {
13349 pub const ENCODED_LEN: usize = 35usize;
13350 pub const DEFAULT: Self = Self {
13351 time_last_baseline_ms: 0_u32,
13352 tow: 0_u32,
13353 baseline_a_mm: 0_i32,
13354 baseline_b_mm: 0_i32,
13355 baseline_c_mm: 0_i32,
13356 accuracy: 0_u32,
13357 iar_num_hypotheses: 0_i32,
13358 wn: 0_u16,
13359 rtk_receiver_id: 0_u8,
13360 rtk_health: 0_u8,
13361 rtk_rate: 0_u8,
13362 nsats: 0_u8,
13363 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
13364 };
13365 #[cfg(feature = "arbitrary")]
13366 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13367 use arbitrary::{Arbitrary, Unstructured};
13368 let mut buf = [0u8; 1024];
13369 rng.fill_bytes(&mut buf);
13370 let mut unstructured = Unstructured::new(&buf);
13371 Self::arbitrary(&mut unstructured).unwrap_or_default()
13372 }
13373}
13374impl Default for GPS2_RTK_DATA {
13375 fn default() -> Self {
13376 Self::DEFAULT.clone()
13377 }
13378}
13379impl MessageData for GPS2_RTK_DATA {
13380 type Message = MavMessage;
13381 const ID: u32 = 128u32;
13382 const NAME: &'static str = "GPS2_RTK";
13383 const EXTRA_CRC: u8 = 226u8;
13384 const ENCODED_LEN: usize = 35usize;
13385 fn deser(
13386 _version: MavlinkVersion,
13387 __input: &[u8],
13388 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13389 let avail_len = __input.len();
13390 let mut payload_buf = [0; Self::ENCODED_LEN];
13391 let mut buf = if avail_len < Self::ENCODED_LEN {
13392 payload_buf[0..avail_len].copy_from_slice(__input);
13393 Bytes::new(&payload_buf)
13394 } else {
13395 Bytes::new(__input)
13396 };
13397 let mut __struct = Self::default();
13398 __struct.time_last_baseline_ms = buf.get_u32_le();
13399 __struct.tow = buf.get_u32_le();
13400 __struct.baseline_a_mm = buf.get_i32_le();
13401 __struct.baseline_b_mm = buf.get_i32_le();
13402 __struct.baseline_c_mm = buf.get_i32_le();
13403 __struct.accuracy = buf.get_u32_le();
13404 __struct.iar_num_hypotheses = buf.get_i32_le();
13405 __struct.wn = buf.get_u16_le();
13406 __struct.rtk_receiver_id = buf.get_u8();
13407 __struct.rtk_health = buf.get_u8();
13408 __struct.rtk_rate = buf.get_u8();
13409 __struct.nsats = buf.get_u8();
13410 let tmp = buf.get_u8();
13411 __struct.baseline_coords_type =
13412 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13413 enum_type: "RtkBaselineCoordinateSystem",
13414 value: tmp as u32,
13415 })?;
13416 Ok(__struct)
13417 }
13418 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13419 let mut __tmp = BytesMut::new(bytes);
13420 #[allow(clippy::absurd_extreme_comparisons)]
13421 #[allow(unused_comparisons)]
13422 if __tmp.remaining() < Self::ENCODED_LEN {
13423 panic!(
13424 "buffer is too small (need {} bytes, but got {})",
13425 Self::ENCODED_LEN,
13426 __tmp.remaining(),
13427 )
13428 }
13429 __tmp.put_u32_le(self.time_last_baseline_ms);
13430 __tmp.put_u32_le(self.tow);
13431 __tmp.put_i32_le(self.baseline_a_mm);
13432 __tmp.put_i32_le(self.baseline_b_mm);
13433 __tmp.put_i32_le(self.baseline_c_mm);
13434 __tmp.put_u32_le(self.accuracy);
13435 __tmp.put_i32_le(self.iar_num_hypotheses);
13436 __tmp.put_u16_le(self.wn);
13437 __tmp.put_u8(self.rtk_receiver_id);
13438 __tmp.put_u8(self.rtk_health);
13439 __tmp.put_u8(self.rtk_rate);
13440 __tmp.put_u8(self.nsats);
13441 __tmp.put_u8(self.baseline_coords_type as u8);
13442 if matches!(version, MavlinkVersion::V2) {
13443 let len = __tmp.len();
13444 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13445 } else {
13446 __tmp.len()
13447 }
13448 }
13449}
13450#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
13451#[doc = ""]
13452#[doc = "ID: 49"]
13453#[derive(Debug, Clone, PartialEq)]
13454#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13455#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13456pub struct GPS_GLOBAL_ORIGIN_DATA {
13457 #[doc = "Latitude (WGS84)"]
13458 pub latitude: i32,
13459 #[doc = "Longitude (WGS84)"]
13460 pub longitude: i32,
13461 #[doc = "Altitude (MSL). Positive for up."]
13462 pub altitude: i32,
13463 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13464 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13465 pub time_usec: u64,
13466}
13467impl GPS_GLOBAL_ORIGIN_DATA {
13468 pub const ENCODED_LEN: usize = 20usize;
13469 pub const DEFAULT: Self = Self {
13470 latitude: 0_i32,
13471 longitude: 0_i32,
13472 altitude: 0_i32,
13473 time_usec: 0_u64,
13474 };
13475 #[cfg(feature = "arbitrary")]
13476 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13477 use arbitrary::{Arbitrary, Unstructured};
13478 let mut buf = [0u8; 1024];
13479 rng.fill_bytes(&mut buf);
13480 let mut unstructured = Unstructured::new(&buf);
13481 Self::arbitrary(&mut unstructured).unwrap_or_default()
13482 }
13483}
13484impl Default for GPS_GLOBAL_ORIGIN_DATA {
13485 fn default() -> Self {
13486 Self::DEFAULT.clone()
13487 }
13488}
13489impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
13490 type Message = MavMessage;
13491 const ID: u32 = 49u32;
13492 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
13493 const EXTRA_CRC: u8 = 39u8;
13494 const ENCODED_LEN: usize = 20usize;
13495 fn deser(
13496 _version: MavlinkVersion,
13497 __input: &[u8],
13498 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13499 let avail_len = __input.len();
13500 let mut payload_buf = [0; Self::ENCODED_LEN];
13501 let mut buf = if avail_len < Self::ENCODED_LEN {
13502 payload_buf[0..avail_len].copy_from_slice(__input);
13503 Bytes::new(&payload_buf)
13504 } else {
13505 Bytes::new(__input)
13506 };
13507 let mut __struct = Self::default();
13508 __struct.latitude = buf.get_i32_le();
13509 __struct.longitude = buf.get_i32_le();
13510 __struct.altitude = buf.get_i32_le();
13511 __struct.time_usec = buf.get_u64_le();
13512 Ok(__struct)
13513 }
13514 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13515 let mut __tmp = BytesMut::new(bytes);
13516 #[allow(clippy::absurd_extreme_comparisons)]
13517 #[allow(unused_comparisons)]
13518 if __tmp.remaining() < Self::ENCODED_LEN {
13519 panic!(
13520 "buffer is too small (need {} bytes, but got {})",
13521 Self::ENCODED_LEN,
13522 __tmp.remaining(),
13523 )
13524 }
13525 __tmp.put_i32_le(self.latitude);
13526 __tmp.put_i32_le(self.longitude);
13527 __tmp.put_i32_le(self.altitude);
13528 if matches!(version, MavlinkVersion::V2) {
13529 __tmp.put_u64_le(self.time_usec);
13530 let len = __tmp.len();
13531 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13532 } else {
13533 __tmp.len()
13534 }
13535 }
13536}
13537#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
13538#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
13539#[doc = ""]
13540#[doc = "ID: 123"]
13541#[derive(Debug, Clone, PartialEq)]
13542#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13543#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13544pub struct GPS_INJECT_DATA_DATA {
13545 #[doc = "System ID"]
13546 pub target_system: u8,
13547 #[doc = "Component ID"]
13548 pub target_component: u8,
13549 #[doc = "Data length"]
13550 pub len: u8,
13551 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
13552 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13553 pub data: [u8; 110],
13554}
13555impl GPS_INJECT_DATA_DATA {
13556 pub const ENCODED_LEN: usize = 113usize;
13557 pub const DEFAULT: Self = Self {
13558 target_system: 0_u8,
13559 target_component: 0_u8,
13560 len: 0_u8,
13561 data: [0_u8; 110usize],
13562 };
13563 #[cfg(feature = "arbitrary")]
13564 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13565 use arbitrary::{Arbitrary, Unstructured};
13566 let mut buf = [0u8; 1024];
13567 rng.fill_bytes(&mut buf);
13568 let mut unstructured = Unstructured::new(&buf);
13569 Self::arbitrary(&mut unstructured).unwrap_or_default()
13570 }
13571}
13572impl Default for GPS_INJECT_DATA_DATA {
13573 fn default() -> Self {
13574 Self::DEFAULT.clone()
13575 }
13576}
13577impl MessageData for GPS_INJECT_DATA_DATA {
13578 type Message = MavMessage;
13579 const ID: u32 = 123u32;
13580 const NAME: &'static str = "GPS_INJECT_DATA";
13581 const EXTRA_CRC: u8 = 250u8;
13582 const ENCODED_LEN: usize = 113usize;
13583 fn deser(
13584 _version: MavlinkVersion,
13585 __input: &[u8],
13586 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13587 let avail_len = __input.len();
13588 let mut payload_buf = [0; Self::ENCODED_LEN];
13589 let mut buf = if avail_len < Self::ENCODED_LEN {
13590 payload_buf[0..avail_len].copy_from_slice(__input);
13591 Bytes::new(&payload_buf)
13592 } else {
13593 Bytes::new(__input)
13594 };
13595 let mut __struct = Self::default();
13596 __struct.target_system = buf.get_u8();
13597 __struct.target_component = buf.get_u8();
13598 __struct.len = buf.get_u8();
13599 for v in &mut __struct.data {
13600 let val = buf.get_u8();
13601 *v = val;
13602 }
13603 Ok(__struct)
13604 }
13605 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13606 let mut __tmp = BytesMut::new(bytes);
13607 #[allow(clippy::absurd_extreme_comparisons)]
13608 #[allow(unused_comparisons)]
13609 if __tmp.remaining() < Self::ENCODED_LEN {
13610 panic!(
13611 "buffer is too small (need {} bytes, but got {})",
13612 Self::ENCODED_LEN,
13613 __tmp.remaining(),
13614 )
13615 }
13616 __tmp.put_u8(self.target_system);
13617 __tmp.put_u8(self.target_component);
13618 __tmp.put_u8(self.len);
13619 for val in &self.data {
13620 __tmp.put_u8(*val);
13621 }
13622 if matches!(version, MavlinkVersion::V2) {
13623 let len = __tmp.len();
13624 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13625 } else {
13626 __tmp.len()
13627 }
13628 }
13629}
13630#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
13631#[doc = ""]
13632#[doc = "ID: 232"]
13633#[derive(Debug, Clone, PartialEq)]
13634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13635#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13636pub struct GPS_INPUT_DATA {
13637 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13638 pub time_usec: u64,
13639 #[doc = "GPS time (from start of GPS week)"]
13640 pub time_week_ms: u32,
13641 #[doc = "Latitude (WGS84)"]
13642 pub lat: i32,
13643 #[doc = "Longitude (WGS84)"]
13644 pub lon: i32,
13645 #[doc = "Altitude (MSL). Positive for up."]
13646 pub alt: f32,
13647 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
13648 pub hdop: f32,
13649 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
13650 pub vdop: f32,
13651 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
13652 pub vn: f32,
13653 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
13654 pub ve: f32,
13655 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
13656 pub vd: f32,
13657 #[doc = "GPS speed accuracy"]
13658 pub speed_accuracy: f32,
13659 #[doc = "GPS horizontal accuracy"]
13660 pub horiz_accuracy: f32,
13661 #[doc = "GPS vertical accuracy"]
13662 pub vert_accuracy: f32,
13663 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
13664 pub ignore_flags: GpsInputIgnoreFlags,
13665 #[doc = "GPS week number"]
13666 pub time_week: u16,
13667 #[doc = "ID of the GPS for multiple GPS inputs"]
13668 pub gps_id: u8,
13669 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
13670 pub fix_type: u8,
13671 #[doc = "Number of satellites visible."]
13672 pub satellites_visible: u8,
13673 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
13674 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13675 pub yaw: u16,
13676}
13677impl GPS_INPUT_DATA {
13678 pub const ENCODED_LEN: usize = 65usize;
13679 pub const DEFAULT: Self = Self {
13680 time_usec: 0_u64,
13681 time_week_ms: 0_u32,
13682 lat: 0_i32,
13683 lon: 0_i32,
13684 alt: 0.0_f32,
13685 hdop: 0.0_f32,
13686 vdop: 0.0_f32,
13687 vn: 0.0_f32,
13688 ve: 0.0_f32,
13689 vd: 0.0_f32,
13690 speed_accuracy: 0.0_f32,
13691 horiz_accuracy: 0.0_f32,
13692 vert_accuracy: 0.0_f32,
13693 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
13694 time_week: 0_u16,
13695 gps_id: 0_u8,
13696 fix_type: 0_u8,
13697 satellites_visible: 0_u8,
13698 yaw: 0_u16,
13699 };
13700 #[cfg(feature = "arbitrary")]
13701 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13702 use arbitrary::{Arbitrary, Unstructured};
13703 let mut buf = [0u8; 1024];
13704 rng.fill_bytes(&mut buf);
13705 let mut unstructured = Unstructured::new(&buf);
13706 Self::arbitrary(&mut unstructured).unwrap_or_default()
13707 }
13708}
13709impl Default for GPS_INPUT_DATA {
13710 fn default() -> Self {
13711 Self::DEFAULT.clone()
13712 }
13713}
13714impl MessageData for GPS_INPUT_DATA {
13715 type Message = MavMessage;
13716 const ID: u32 = 232u32;
13717 const NAME: &'static str = "GPS_INPUT";
13718 const EXTRA_CRC: u8 = 151u8;
13719 const ENCODED_LEN: usize = 65usize;
13720 fn deser(
13721 _version: MavlinkVersion,
13722 __input: &[u8],
13723 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13724 let avail_len = __input.len();
13725 let mut payload_buf = [0; Self::ENCODED_LEN];
13726 let mut buf = if avail_len < Self::ENCODED_LEN {
13727 payload_buf[0..avail_len].copy_from_slice(__input);
13728 Bytes::new(&payload_buf)
13729 } else {
13730 Bytes::new(__input)
13731 };
13732 let mut __struct = Self::default();
13733 __struct.time_usec = buf.get_u64_le();
13734 __struct.time_week_ms = buf.get_u32_le();
13735 __struct.lat = buf.get_i32_le();
13736 __struct.lon = buf.get_i32_le();
13737 __struct.alt = buf.get_f32_le();
13738 __struct.hdop = buf.get_f32_le();
13739 __struct.vdop = buf.get_f32_le();
13740 __struct.vn = buf.get_f32_le();
13741 __struct.ve = buf.get_f32_le();
13742 __struct.vd = buf.get_f32_le();
13743 __struct.speed_accuracy = buf.get_f32_le();
13744 __struct.horiz_accuracy = buf.get_f32_le();
13745 __struct.vert_accuracy = buf.get_f32_le();
13746 let tmp = buf.get_u16_le();
13747 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
13748 tmp & GpsInputIgnoreFlags::all().bits(),
13749 )
13750 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13751 flag_type: "GpsInputIgnoreFlags",
13752 value: tmp as u32,
13753 })?;
13754 __struct.time_week = buf.get_u16_le();
13755 __struct.gps_id = buf.get_u8();
13756 __struct.fix_type = buf.get_u8();
13757 __struct.satellites_visible = buf.get_u8();
13758 __struct.yaw = buf.get_u16_le();
13759 Ok(__struct)
13760 }
13761 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13762 let mut __tmp = BytesMut::new(bytes);
13763 #[allow(clippy::absurd_extreme_comparisons)]
13764 #[allow(unused_comparisons)]
13765 if __tmp.remaining() < Self::ENCODED_LEN {
13766 panic!(
13767 "buffer is too small (need {} bytes, but got {})",
13768 Self::ENCODED_LEN,
13769 __tmp.remaining(),
13770 )
13771 }
13772 __tmp.put_u64_le(self.time_usec);
13773 __tmp.put_u32_le(self.time_week_ms);
13774 __tmp.put_i32_le(self.lat);
13775 __tmp.put_i32_le(self.lon);
13776 __tmp.put_f32_le(self.alt);
13777 __tmp.put_f32_le(self.hdop);
13778 __tmp.put_f32_le(self.vdop);
13779 __tmp.put_f32_le(self.vn);
13780 __tmp.put_f32_le(self.ve);
13781 __tmp.put_f32_le(self.vd);
13782 __tmp.put_f32_le(self.speed_accuracy);
13783 __tmp.put_f32_le(self.horiz_accuracy);
13784 __tmp.put_f32_le(self.vert_accuracy);
13785 __tmp.put_u16_le(self.ignore_flags.bits());
13786 __tmp.put_u16_le(self.time_week);
13787 __tmp.put_u8(self.gps_id);
13788 __tmp.put_u8(self.fix_type);
13789 __tmp.put_u8(self.satellites_visible);
13790 if matches!(version, MavlinkVersion::V2) {
13791 __tmp.put_u16_le(self.yaw);
13792 let len = __tmp.len();
13793 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13794 } else {
13795 __tmp.len()
13796 }
13797 }
13798}
13799#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
13800#[doc = ""]
13801#[doc = "ID: 24"]
13802#[derive(Debug, Clone, PartialEq)]
13803#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13804#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13805pub struct GPS_RAW_INT_DATA {
13806 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13807 pub time_usec: u64,
13808 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
13809 pub lat: i32,
13810 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
13811 pub lon: i32,
13812 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
13813 pub alt: i32,
13814 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13815 pub eph: u16,
13816 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13817 pub epv: u16,
13818 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13819 pub vel: u16,
13820 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13821 pub cog: u16,
13822 #[doc = "GPS fix type."]
13823 pub fix_type: GpsFixType,
13824 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13825 pub satellites_visible: u8,
13826 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13827 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13828 pub alt_ellipsoid: i32,
13829 #[doc = "Position uncertainty."]
13830 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13831 pub h_acc: u32,
13832 #[doc = "Altitude uncertainty."]
13833 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13834 pub v_acc: u32,
13835 #[doc = "Speed uncertainty."]
13836 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13837 pub vel_acc: u32,
13838 #[doc = "Heading / track uncertainty"]
13839 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13840 pub hdg_acc: u32,
13841 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13842 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13843 pub yaw: u16,
13844}
13845impl GPS_RAW_INT_DATA {
13846 pub const ENCODED_LEN: usize = 52usize;
13847 pub const DEFAULT: Self = Self {
13848 time_usec: 0_u64,
13849 lat: 0_i32,
13850 lon: 0_i32,
13851 alt: 0_i32,
13852 eph: 0_u16,
13853 epv: 0_u16,
13854 vel: 0_u16,
13855 cog: 0_u16,
13856 fix_type: GpsFixType::DEFAULT,
13857 satellites_visible: 0_u8,
13858 alt_ellipsoid: 0_i32,
13859 h_acc: 0_u32,
13860 v_acc: 0_u32,
13861 vel_acc: 0_u32,
13862 hdg_acc: 0_u32,
13863 yaw: 0_u16,
13864 };
13865 #[cfg(feature = "arbitrary")]
13866 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13867 use arbitrary::{Arbitrary, Unstructured};
13868 let mut buf = [0u8; 1024];
13869 rng.fill_bytes(&mut buf);
13870 let mut unstructured = Unstructured::new(&buf);
13871 Self::arbitrary(&mut unstructured).unwrap_or_default()
13872 }
13873}
13874impl Default for GPS_RAW_INT_DATA {
13875 fn default() -> Self {
13876 Self::DEFAULT.clone()
13877 }
13878}
13879impl MessageData for GPS_RAW_INT_DATA {
13880 type Message = MavMessage;
13881 const ID: u32 = 24u32;
13882 const NAME: &'static str = "GPS_RAW_INT";
13883 const EXTRA_CRC: u8 = 24u8;
13884 const ENCODED_LEN: usize = 52usize;
13885 fn deser(
13886 _version: MavlinkVersion,
13887 __input: &[u8],
13888 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13889 let avail_len = __input.len();
13890 let mut payload_buf = [0; Self::ENCODED_LEN];
13891 let mut buf = if avail_len < Self::ENCODED_LEN {
13892 payload_buf[0..avail_len].copy_from_slice(__input);
13893 Bytes::new(&payload_buf)
13894 } else {
13895 Bytes::new(__input)
13896 };
13897 let mut __struct = Self::default();
13898 __struct.time_usec = buf.get_u64_le();
13899 __struct.lat = buf.get_i32_le();
13900 __struct.lon = buf.get_i32_le();
13901 __struct.alt = buf.get_i32_le();
13902 __struct.eph = buf.get_u16_le();
13903 __struct.epv = buf.get_u16_le();
13904 __struct.vel = buf.get_u16_le();
13905 __struct.cog = buf.get_u16_le();
13906 let tmp = buf.get_u8();
13907 __struct.fix_type =
13908 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13909 enum_type: "GpsFixType",
13910 value: tmp as u32,
13911 })?;
13912 __struct.satellites_visible = buf.get_u8();
13913 __struct.alt_ellipsoid = buf.get_i32_le();
13914 __struct.h_acc = buf.get_u32_le();
13915 __struct.v_acc = buf.get_u32_le();
13916 __struct.vel_acc = buf.get_u32_le();
13917 __struct.hdg_acc = buf.get_u32_le();
13918 __struct.yaw = buf.get_u16_le();
13919 Ok(__struct)
13920 }
13921 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13922 let mut __tmp = BytesMut::new(bytes);
13923 #[allow(clippy::absurd_extreme_comparisons)]
13924 #[allow(unused_comparisons)]
13925 if __tmp.remaining() < Self::ENCODED_LEN {
13926 panic!(
13927 "buffer is too small (need {} bytes, but got {})",
13928 Self::ENCODED_LEN,
13929 __tmp.remaining(),
13930 )
13931 }
13932 __tmp.put_u64_le(self.time_usec);
13933 __tmp.put_i32_le(self.lat);
13934 __tmp.put_i32_le(self.lon);
13935 __tmp.put_i32_le(self.alt);
13936 __tmp.put_u16_le(self.eph);
13937 __tmp.put_u16_le(self.epv);
13938 __tmp.put_u16_le(self.vel);
13939 __tmp.put_u16_le(self.cog);
13940 __tmp.put_u8(self.fix_type as u8);
13941 __tmp.put_u8(self.satellites_visible);
13942 if matches!(version, MavlinkVersion::V2) {
13943 __tmp.put_i32_le(self.alt_ellipsoid);
13944 __tmp.put_u32_le(self.h_acc);
13945 __tmp.put_u32_le(self.v_acc);
13946 __tmp.put_u32_le(self.vel_acc);
13947 __tmp.put_u32_le(self.hdg_acc);
13948 __tmp.put_u16_le(self.yaw);
13949 let len = __tmp.len();
13950 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13951 } else {
13952 __tmp.len()
13953 }
13954 }
13955}
13956#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
13957#[doc = ""]
13958#[doc = "ID: 233"]
13959#[derive(Debug, Clone, PartialEq)]
13960#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13962pub struct GPS_RTCM_DATA_DATA {
13963 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
13964 pub flags: u8,
13965 #[doc = "data length"]
13966 pub len: u8,
13967 #[doc = "RTCM message (may be fragmented)"]
13968 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13969 pub data: [u8; 180],
13970}
13971impl GPS_RTCM_DATA_DATA {
13972 pub const ENCODED_LEN: usize = 182usize;
13973 pub const DEFAULT: Self = Self {
13974 flags: 0_u8,
13975 len: 0_u8,
13976 data: [0_u8; 180usize],
13977 };
13978 #[cfg(feature = "arbitrary")]
13979 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13980 use arbitrary::{Arbitrary, Unstructured};
13981 let mut buf = [0u8; 1024];
13982 rng.fill_bytes(&mut buf);
13983 let mut unstructured = Unstructured::new(&buf);
13984 Self::arbitrary(&mut unstructured).unwrap_or_default()
13985 }
13986}
13987impl Default for GPS_RTCM_DATA_DATA {
13988 fn default() -> Self {
13989 Self::DEFAULT.clone()
13990 }
13991}
13992impl MessageData for GPS_RTCM_DATA_DATA {
13993 type Message = MavMessage;
13994 const ID: u32 = 233u32;
13995 const NAME: &'static str = "GPS_RTCM_DATA";
13996 const EXTRA_CRC: u8 = 35u8;
13997 const ENCODED_LEN: usize = 182usize;
13998 fn deser(
13999 _version: MavlinkVersion,
14000 __input: &[u8],
14001 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14002 let avail_len = __input.len();
14003 let mut payload_buf = [0; Self::ENCODED_LEN];
14004 let mut buf = if avail_len < Self::ENCODED_LEN {
14005 payload_buf[0..avail_len].copy_from_slice(__input);
14006 Bytes::new(&payload_buf)
14007 } else {
14008 Bytes::new(__input)
14009 };
14010 let mut __struct = Self::default();
14011 __struct.flags = buf.get_u8();
14012 __struct.len = buf.get_u8();
14013 for v in &mut __struct.data {
14014 let val = buf.get_u8();
14015 *v = val;
14016 }
14017 Ok(__struct)
14018 }
14019 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14020 let mut __tmp = BytesMut::new(bytes);
14021 #[allow(clippy::absurd_extreme_comparisons)]
14022 #[allow(unused_comparisons)]
14023 if __tmp.remaining() < Self::ENCODED_LEN {
14024 panic!(
14025 "buffer is too small (need {} bytes, but got {})",
14026 Self::ENCODED_LEN,
14027 __tmp.remaining(),
14028 )
14029 }
14030 __tmp.put_u8(self.flags);
14031 __tmp.put_u8(self.len);
14032 for val in &self.data {
14033 __tmp.put_u8(*val);
14034 }
14035 if matches!(version, MavlinkVersion::V2) {
14036 let len = __tmp.len();
14037 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14038 } else {
14039 __tmp.len()
14040 }
14041 }
14042}
14043#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14044#[doc = ""]
14045#[doc = "ID: 127"]
14046#[derive(Debug, Clone, PartialEq)]
14047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14049pub struct GPS_RTK_DATA {
14050 #[doc = "Time since boot of last baseline message received."]
14051 pub time_last_baseline_ms: u32,
14052 #[doc = "GPS Time of Week of last baseline"]
14053 pub tow: u32,
14054 #[doc = "Current baseline in ECEF x or NED north component."]
14055 pub baseline_a_mm: i32,
14056 #[doc = "Current baseline in ECEF y or NED east component."]
14057 pub baseline_b_mm: i32,
14058 #[doc = "Current baseline in ECEF z or NED down component."]
14059 pub baseline_c_mm: i32,
14060 #[doc = "Current estimate of baseline accuracy."]
14061 pub accuracy: u32,
14062 #[doc = "Current number of integer ambiguity hypotheses."]
14063 pub iar_num_hypotheses: i32,
14064 #[doc = "GPS Week Number of last baseline"]
14065 pub wn: u16,
14066 #[doc = "Identification of connected RTK receiver."]
14067 pub rtk_receiver_id: u8,
14068 #[doc = "GPS-specific health report for RTK data."]
14069 pub rtk_health: u8,
14070 #[doc = "Rate of baseline messages being received by GPS"]
14071 pub rtk_rate: u8,
14072 #[doc = "Current number of sats used for RTK calculation."]
14073 pub nsats: u8,
14074 #[doc = "Coordinate system of baseline"]
14075 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14076}
14077impl GPS_RTK_DATA {
14078 pub const ENCODED_LEN: usize = 35usize;
14079 pub const DEFAULT: Self = Self {
14080 time_last_baseline_ms: 0_u32,
14081 tow: 0_u32,
14082 baseline_a_mm: 0_i32,
14083 baseline_b_mm: 0_i32,
14084 baseline_c_mm: 0_i32,
14085 accuracy: 0_u32,
14086 iar_num_hypotheses: 0_i32,
14087 wn: 0_u16,
14088 rtk_receiver_id: 0_u8,
14089 rtk_health: 0_u8,
14090 rtk_rate: 0_u8,
14091 nsats: 0_u8,
14092 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14093 };
14094 #[cfg(feature = "arbitrary")]
14095 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14096 use arbitrary::{Arbitrary, Unstructured};
14097 let mut buf = [0u8; 1024];
14098 rng.fill_bytes(&mut buf);
14099 let mut unstructured = Unstructured::new(&buf);
14100 Self::arbitrary(&mut unstructured).unwrap_or_default()
14101 }
14102}
14103impl Default for GPS_RTK_DATA {
14104 fn default() -> Self {
14105 Self::DEFAULT.clone()
14106 }
14107}
14108impl MessageData for GPS_RTK_DATA {
14109 type Message = MavMessage;
14110 const ID: u32 = 127u32;
14111 const NAME: &'static str = "GPS_RTK";
14112 const EXTRA_CRC: u8 = 25u8;
14113 const ENCODED_LEN: usize = 35usize;
14114 fn deser(
14115 _version: MavlinkVersion,
14116 __input: &[u8],
14117 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14118 let avail_len = __input.len();
14119 let mut payload_buf = [0; Self::ENCODED_LEN];
14120 let mut buf = if avail_len < Self::ENCODED_LEN {
14121 payload_buf[0..avail_len].copy_from_slice(__input);
14122 Bytes::new(&payload_buf)
14123 } else {
14124 Bytes::new(__input)
14125 };
14126 let mut __struct = Self::default();
14127 __struct.time_last_baseline_ms = buf.get_u32_le();
14128 __struct.tow = buf.get_u32_le();
14129 __struct.baseline_a_mm = buf.get_i32_le();
14130 __struct.baseline_b_mm = buf.get_i32_le();
14131 __struct.baseline_c_mm = buf.get_i32_le();
14132 __struct.accuracy = buf.get_u32_le();
14133 __struct.iar_num_hypotheses = buf.get_i32_le();
14134 __struct.wn = buf.get_u16_le();
14135 __struct.rtk_receiver_id = buf.get_u8();
14136 __struct.rtk_health = buf.get_u8();
14137 __struct.rtk_rate = buf.get_u8();
14138 __struct.nsats = buf.get_u8();
14139 let tmp = buf.get_u8();
14140 __struct.baseline_coords_type =
14141 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14142 enum_type: "RtkBaselineCoordinateSystem",
14143 value: tmp as u32,
14144 })?;
14145 Ok(__struct)
14146 }
14147 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14148 let mut __tmp = BytesMut::new(bytes);
14149 #[allow(clippy::absurd_extreme_comparisons)]
14150 #[allow(unused_comparisons)]
14151 if __tmp.remaining() < Self::ENCODED_LEN {
14152 panic!(
14153 "buffer is too small (need {} bytes, but got {})",
14154 Self::ENCODED_LEN,
14155 __tmp.remaining(),
14156 )
14157 }
14158 __tmp.put_u32_le(self.time_last_baseline_ms);
14159 __tmp.put_u32_le(self.tow);
14160 __tmp.put_i32_le(self.baseline_a_mm);
14161 __tmp.put_i32_le(self.baseline_b_mm);
14162 __tmp.put_i32_le(self.baseline_c_mm);
14163 __tmp.put_u32_le(self.accuracy);
14164 __tmp.put_i32_le(self.iar_num_hypotheses);
14165 __tmp.put_u16_le(self.wn);
14166 __tmp.put_u8(self.rtk_receiver_id);
14167 __tmp.put_u8(self.rtk_health);
14168 __tmp.put_u8(self.rtk_rate);
14169 __tmp.put_u8(self.nsats);
14170 __tmp.put_u8(self.baseline_coords_type as u8);
14171 if matches!(version, MavlinkVersion::V2) {
14172 let len = __tmp.len();
14173 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14174 } else {
14175 __tmp.len()
14176 }
14177 }
14178}
14179#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14180#[doc = ""]
14181#[doc = "ID: 25"]
14182#[derive(Debug, Clone, PartialEq)]
14183#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14185pub struct GPS_STATUS_DATA {
14186 #[doc = "Number of satellites visible"]
14187 pub satellites_visible: u8,
14188 #[doc = "Global satellite ID"]
14189 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14190 pub satellite_prn: [u8; 20],
14191 #[doc = "0: Satellite not used, 1: used for localization"]
14192 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14193 pub satellite_used: [u8; 20],
14194 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14195 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14196 pub satellite_elevation: [u8; 20],
14197 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14198 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14199 pub satellite_azimuth: [u8; 20],
14200 #[doc = "Signal to noise ratio of satellite"]
14201 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14202 pub satellite_snr: [u8; 20],
14203}
14204impl GPS_STATUS_DATA {
14205 pub const ENCODED_LEN: usize = 101usize;
14206 pub const DEFAULT: Self = Self {
14207 satellites_visible: 0_u8,
14208 satellite_prn: [0_u8; 20usize],
14209 satellite_used: [0_u8; 20usize],
14210 satellite_elevation: [0_u8; 20usize],
14211 satellite_azimuth: [0_u8; 20usize],
14212 satellite_snr: [0_u8; 20usize],
14213 };
14214 #[cfg(feature = "arbitrary")]
14215 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14216 use arbitrary::{Arbitrary, Unstructured};
14217 let mut buf = [0u8; 1024];
14218 rng.fill_bytes(&mut buf);
14219 let mut unstructured = Unstructured::new(&buf);
14220 Self::arbitrary(&mut unstructured).unwrap_or_default()
14221 }
14222}
14223impl Default for GPS_STATUS_DATA {
14224 fn default() -> Self {
14225 Self::DEFAULT.clone()
14226 }
14227}
14228impl MessageData for GPS_STATUS_DATA {
14229 type Message = MavMessage;
14230 const ID: u32 = 25u32;
14231 const NAME: &'static str = "GPS_STATUS";
14232 const EXTRA_CRC: u8 = 23u8;
14233 const ENCODED_LEN: usize = 101usize;
14234 fn deser(
14235 _version: MavlinkVersion,
14236 __input: &[u8],
14237 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14238 let avail_len = __input.len();
14239 let mut payload_buf = [0; Self::ENCODED_LEN];
14240 let mut buf = if avail_len < Self::ENCODED_LEN {
14241 payload_buf[0..avail_len].copy_from_slice(__input);
14242 Bytes::new(&payload_buf)
14243 } else {
14244 Bytes::new(__input)
14245 };
14246 let mut __struct = Self::default();
14247 __struct.satellites_visible = buf.get_u8();
14248 for v in &mut __struct.satellite_prn {
14249 let val = buf.get_u8();
14250 *v = val;
14251 }
14252 for v in &mut __struct.satellite_used {
14253 let val = buf.get_u8();
14254 *v = val;
14255 }
14256 for v in &mut __struct.satellite_elevation {
14257 let val = buf.get_u8();
14258 *v = val;
14259 }
14260 for v in &mut __struct.satellite_azimuth {
14261 let val = buf.get_u8();
14262 *v = val;
14263 }
14264 for v in &mut __struct.satellite_snr {
14265 let val = buf.get_u8();
14266 *v = val;
14267 }
14268 Ok(__struct)
14269 }
14270 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14271 let mut __tmp = BytesMut::new(bytes);
14272 #[allow(clippy::absurd_extreme_comparisons)]
14273 #[allow(unused_comparisons)]
14274 if __tmp.remaining() < Self::ENCODED_LEN {
14275 panic!(
14276 "buffer is too small (need {} bytes, but got {})",
14277 Self::ENCODED_LEN,
14278 __tmp.remaining(),
14279 )
14280 }
14281 __tmp.put_u8(self.satellites_visible);
14282 for val in &self.satellite_prn {
14283 __tmp.put_u8(*val);
14284 }
14285 for val in &self.satellite_used {
14286 __tmp.put_u8(*val);
14287 }
14288 for val in &self.satellite_elevation {
14289 __tmp.put_u8(*val);
14290 }
14291 for val in &self.satellite_azimuth {
14292 __tmp.put_u8(*val);
14293 }
14294 for val in &self.satellite_snr {
14295 __tmp.put_u8(*val);
14296 }
14297 if matches!(version, MavlinkVersion::V2) {
14298 let len = __tmp.len();
14299 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14300 } else {
14301 __tmp.len()
14302 }
14303 }
14304}
14305#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
14306#[doc = ""]
14307#[doc = "ID: 0"]
14308#[derive(Debug, Clone, PartialEq)]
14309#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14310#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14311pub struct HEARTBEAT_DATA {
14312 #[doc = "A bitfield for use for autopilot-specific flags"]
14313 pub custom_mode: u32,
14314 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
14315 pub mavtype: MavType,
14316 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14317 pub autopilot: MavAutopilot,
14318 #[doc = "System mode bitmap."]
14319 pub base_mode: MavModeFlag,
14320 #[doc = "System status flag."]
14321 pub system_status: MavState,
14322 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
14323 pub mavlink_version: u8,
14324}
14325impl HEARTBEAT_DATA {
14326 pub const ENCODED_LEN: usize = 9usize;
14327 pub const DEFAULT: Self = Self {
14328 custom_mode: 0_u32,
14329 mavtype: MavType::DEFAULT,
14330 autopilot: MavAutopilot::DEFAULT,
14331 base_mode: MavModeFlag::DEFAULT,
14332 system_status: MavState::DEFAULT,
14333 mavlink_version: MINOR_MAVLINK_VERSION,
14334 };
14335 #[cfg(feature = "arbitrary")]
14336 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14337 use arbitrary::{Arbitrary, Unstructured};
14338 let mut buf = [0u8; 1024];
14339 rng.fill_bytes(&mut buf);
14340 let mut unstructured = Unstructured::new(&buf);
14341 Self::arbitrary(&mut unstructured).unwrap_or_default()
14342 }
14343}
14344impl Default for HEARTBEAT_DATA {
14345 fn default() -> Self {
14346 Self::DEFAULT.clone()
14347 }
14348}
14349impl MessageData for HEARTBEAT_DATA {
14350 type Message = MavMessage;
14351 const ID: u32 = 0u32;
14352 const NAME: &'static str = "HEARTBEAT";
14353 const EXTRA_CRC: u8 = 50u8;
14354 const ENCODED_LEN: usize = 9usize;
14355 fn deser(
14356 _version: MavlinkVersion,
14357 __input: &[u8],
14358 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14359 let avail_len = __input.len();
14360 let mut payload_buf = [0; Self::ENCODED_LEN];
14361 let mut buf = if avail_len < Self::ENCODED_LEN {
14362 payload_buf[0..avail_len].copy_from_slice(__input);
14363 Bytes::new(&payload_buf)
14364 } else {
14365 Bytes::new(__input)
14366 };
14367 let mut __struct = Self::default();
14368 __struct.custom_mode = buf.get_u32_le();
14369 let tmp = buf.get_u8();
14370 __struct.mavtype =
14371 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14372 enum_type: "MavType",
14373 value: tmp as u32,
14374 })?;
14375 let tmp = buf.get_u8();
14376 __struct.autopilot =
14377 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14378 enum_type: "MavAutopilot",
14379 value: tmp as u32,
14380 })?;
14381 let tmp = buf.get_u8();
14382 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14383 ::mavlink_core::error::ParserError::InvalidFlag {
14384 flag_type: "MavModeFlag",
14385 value: tmp as u32,
14386 },
14387 )?;
14388 let tmp = buf.get_u8();
14389 __struct.system_status =
14390 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14391 enum_type: "MavState",
14392 value: tmp as u32,
14393 })?;
14394 __struct.mavlink_version = buf.get_u8();
14395 Ok(__struct)
14396 }
14397 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14398 let mut __tmp = BytesMut::new(bytes);
14399 #[allow(clippy::absurd_extreme_comparisons)]
14400 #[allow(unused_comparisons)]
14401 if __tmp.remaining() < Self::ENCODED_LEN {
14402 panic!(
14403 "buffer is too small (need {} bytes, but got {})",
14404 Self::ENCODED_LEN,
14405 __tmp.remaining(),
14406 )
14407 }
14408 __tmp.put_u32_le(self.custom_mode);
14409 __tmp.put_u8(self.mavtype as u8);
14410 __tmp.put_u8(self.autopilot as u8);
14411 __tmp.put_u8(self.base_mode.bits());
14412 __tmp.put_u8(self.system_status as u8);
14413 __tmp.put_u8(self.mavlink_version);
14414 if matches!(version, MavlinkVersion::V2) {
14415 let len = __tmp.len();
14416 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14417 } else {
14418 __tmp.len()
14419 }
14420 }
14421}
14422#[doc = "The IMU readings in SI units in NED body frame."]
14423#[doc = ""]
14424#[doc = "ID: 105"]
14425#[derive(Debug, Clone, PartialEq)]
14426#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14427#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14428pub struct HIGHRES_IMU_DATA {
14429 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14430 pub time_usec: u64,
14431 #[doc = "X acceleration"]
14432 pub xacc: f32,
14433 #[doc = "Y acceleration"]
14434 pub yacc: f32,
14435 #[doc = "Z acceleration"]
14436 pub zacc: f32,
14437 #[doc = "Angular speed around X axis"]
14438 pub xgyro: f32,
14439 #[doc = "Angular speed around Y axis"]
14440 pub ygyro: f32,
14441 #[doc = "Angular speed around Z axis"]
14442 pub zgyro: f32,
14443 #[doc = "X Magnetic field"]
14444 pub xmag: f32,
14445 #[doc = "Y Magnetic field"]
14446 pub ymag: f32,
14447 #[doc = "Z Magnetic field"]
14448 pub zmag: f32,
14449 #[doc = "Absolute pressure"]
14450 pub abs_pressure: f32,
14451 #[doc = "Differential pressure"]
14452 pub diff_pressure: f32,
14453 #[doc = "Altitude calculated from pressure"]
14454 pub pressure_alt: f32,
14455 #[doc = "Temperature"]
14456 pub temperature: f32,
14457 #[doc = "Bitmap for fields that have updated since last message"]
14458 pub fields_updated: HighresImuUpdatedFlags,
14459 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
14460 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14461 pub id: u8,
14462}
14463impl HIGHRES_IMU_DATA {
14464 pub const ENCODED_LEN: usize = 63usize;
14465 pub const DEFAULT: Self = Self {
14466 time_usec: 0_u64,
14467 xacc: 0.0_f32,
14468 yacc: 0.0_f32,
14469 zacc: 0.0_f32,
14470 xgyro: 0.0_f32,
14471 ygyro: 0.0_f32,
14472 zgyro: 0.0_f32,
14473 xmag: 0.0_f32,
14474 ymag: 0.0_f32,
14475 zmag: 0.0_f32,
14476 abs_pressure: 0.0_f32,
14477 diff_pressure: 0.0_f32,
14478 pressure_alt: 0.0_f32,
14479 temperature: 0.0_f32,
14480 fields_updated: HighresImuUpdatedFlags::DEFAULT,
14481 id: 0_u8,
14482 };
14483 #[cfg(feature = "arbitrary")]
14484 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14485 use arbitrary::{Arbitrary, Unstructured};
14486 let mut buf = [0u8; 1024];
14487 rng.fill_bytes(&mut buf);
14488 let mut unstructured = Unstructured::new(&buf);
14489 Self::arbitrary(&mut unstructured).unwrap_or_default()
14490 }
14491}
14492impl Default for HIGHRES_IMU_DATA {
14493 fn default() -> Self {
14494 Self::DEFAULT.clone()
14495 }
14496}
14497impl MessageData for HIGHRES_IMU_DATA {
14498 type Message = MavMessage;
14499 const ID: u32 = 105u32;
14500 const NAME: &'static str = "HIGHRES_IMU";
14501 const EXTRA_CRC: u8 = 93u8;
14502 const ENCODED_LEN: usize = 63usize;
14503 fn deser(
14504 _version: MavlinkVersion,
14505 __input: &[u8],
14506 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14507 let avail_len = __input.len();
14508 let mut payload_buf = [0; Self::ENCODED_LEN];
14509 let mut buf = if avail_len < Self::ENCODED_LEN {
14510 payload_buf[0..avail_len].copy_from_slice(__input);
14511 Bytes::new(&payload_buf)
14512 } else {
14513 Bytes::new(__input)
14514 };
14515 let mut __struct = Self::default();
14516 __struct.time_usec = buf.get_u64_le();
14517 __struct.xacc = buf.get_f32_le();
14518 __struct.yacc = buf.get_f32_le();
14519 __struct.zacc = buf.get_f32_le();
14520 __struct.xgyro = buf.get_f32_le();
14521 __struct.ygyro = buf.get_f32_le();
14522 __struct.zgyro = buf.get_f32_le();
14523 __struct.xmag = buf.get_f32_le();
14524 __struct.ymag = buf.get_f32_le();
14525 __struct.zmag = buf.get_f32_le();
14526 __struct.abs_pressure = buf.get_f32_le();
14527 __struct.diff_pressure = buf.get_f32_le();
14528 __struct.pressure_alt = buf.get_f32_le();
14529 __struct.temperature = buf.get_f32_le();
14530 let tmp = buf.get_u16_le();
14531 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
14532 tmp & HighresImuUpdatedFlags::all().bits(),
14533 )
14534 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14535 flag_type: "HighresImuUpdatedFlags",
14536 value: tmp as u32,
14537 })?;
14538 __struct.id = buf.get_u8();
14539 Ok(__struct)
14540 }
14541 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14542 let mut __tmp = BytesMut::new(bytes);
14543 #[allow(clippy::absurd_extreme_comparisons)]
14544 #[allow(unused_comparisons)]
14545 if __tmp.remaining() < Self::ENCODED_LEN {
14546 panic!(
14547 "buffer is too small (need {} bytes, but got {})",
14548 Self::ENCODED_LEN,
14549 __tmp.remaining(),
14550 )
14551 }
14552 __tmp.put_u64_le(self.time_usec);
14553 __tmp.put_f32_le(self.xacc);
14554 __tmp.put_f32_le(self.yacc);
14555 __tmp.put_f32_le(self.zacc);
14556 __tmp.put_f32_le(self.xgyro);
14557 __tmp.put_f32_le(self.ygyro);
14558 __tmp.put_f32_le(self.zgyro);
14559 __tmp.put_f32_le(self.xmag);
14560 __tmp.put_f32_le(self.ymag);
14561 __tmp.put_f32_le(self.zmag);
14562 __tmp.put_f32_le(self.abs_pressure);
14563 __tmp.put_f32_le(self.diff_pressure);
14564 __tmp.put_f32_le(self.pressure_alt);
14565 __tmp.put_f32_le(self.temperature);
14566 __tmp.put_u16_le(self.fields_updated.bits());
14567 if matches!(version, MavlinkVersion::V2) {
14568 __tmp.put_u8(self.id);
14569 let len = __tmp.len();
14570 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14571 } else {
14572 __tmp.len()
14573 }
14574 }
14575}
14576#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
14577#[doc = "Message appropriate for high latency connections like Iridium."]
14578#[doc = ""]
14579#[doc = "ID: 234"]
14580#[derive(Debug, Clone, PartialEq)]
14581#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14583pub struct HIGH_LATENCY_DATA {
14584 #[doc = "A bitfield for use for autopilot-specific flags."]
14585 pub custom_mode: u32,
14586 #[doc = "Latitude"]
14587 pub latitude: i32,
14588 #[doc = "Longitude"]
14589 pub longitude: i32,
14590 #[doc = "roll"]
14591 pub roll: i16,
14592 #[doc = "pitch"]
14593 pub pitch: i16,
14594 #[doc = "heading"]
14595 pub heading: u16,
14596 #[doc = "heading setpoint"]
14597 pub heading_sp: i16,
14598 #[doc = "Altitude above mean sea level"]
14599 pub altitude_amsl: i16,
14600 #[doc = "Altitude setpoint relative to the home position"]
14601 pub altitude_sp: i16,
14602 #[doc = "distance to target"]
14603 pub wp_distance: u16,
14604 #[doc = "Bitmap of enabled system modes."]
14605 pub base_mode: MavModeFlag,
14606 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
14607 pub landed_state: MavLandedState,
14608 #[doc = "throttle (percentage)"]
14609 pub throttle: i8,
14610 #[doc = "airspeed"]
14611 pub airspeed: u8,
14612 #[doc = "airspeed setpoint"]
14613 pub airspeed_sp: u8,
14614 #[doc = "groundspeed"]
14615 pub groundspeed: u8,
14616 #[doc = "climb rate"]
14617 pub climb_rate: i8,
14618 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14619 pub gps_nsat: u8,
14620 #[doc = "GPS Fix type."]
14621 pub gps_fix_type: GpsFixType,
14622 #[doc = "Remaining battery (percentage)"]
14623 pub battery_remaining: u8,
14624 #[doc = "Autopilot temperature (degrees C)"]
14625 pub temperature: i8,
14626 #[doc = "Air temperature (degrees C) from airspeed sensor"]
14627 pub temperature_air: i8,
14628 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
14629 pub failsafe: u8,
14630 #[doc = "current waypoint number"]
14631 pub wp_num: u8,
14632}
14633impl HIGH_LATENCY_DATA {
14634 pub const ENCODED_LEN: usize = 40usize;
14635 pub const DEFAULT: Self = Self {
14636 custom_mode: 0_u32,
14637 latitude: 0_i32,
14638 longitude: 0_i32,
14639 roll: 0_i16,
14640 pitch: 0_i16,
14641 heading: 0_u16,
14642 heading_sp: 0_i16,
14643 altitude_amsl: 0_i16,
14644 altitude_sp: 0_i16,
14645 wp_distance: 0_u16,
14646 base_mode: MavModeFlag::DEFAULT,
14647 landed_state: MavLandedState::DEFAULT,
14648 throttle: 0_i8,
14649 airspeed: 0_u8,
14650 airspeed_sp: 0_u8,
14651 groundspeed: 0_u8,
14652 climb_rate: 0_i8,
14653 gps_nsat: 0_u8,
14654 gps_fix_type: GpsFixType::DEFAULT,
14655 battery_remaining: 0_u8,
14656 temperature: 0_i8,
14657 temperature_air: 0_i8,
14658 failsafe: 0_u8,
14659 wp_num: 0_u8,
14660 };
14661 #[cfg(feature = "arbitrary")]
14662 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14663 use arbitrary::{Arbitrary, Unstructured};
14664 let mut buf = [0u8; 1024];
14665 rng.fill_bytes(&mut buf);
14666 let mut unstructured = Unstructured::new(&buf);
14667 Self::arbitrary(&mut unstructured).unwrap_or_default()
14668 }
14669}
14670impl Default for HIGH_LATENCY_DATA {
14671 fn default() -> Self {
14672 Self::DEFAULT.clone()
14673 }
14674}
14675impl MessageData for HIGH_LATENCY_DATA {
14676 type Message = MavMessage;
14677 const ID: u32 = 234u32;
14678 const NAME: &'static str = "HIGH_LATENCY";
14679 const EXTRA_CRC: u8 = 150u8;
14680 const ENCODED_LEN: usize = 40usize;
14681 fn deser(
14682 _version: MavlinkVersion,
14683 __input: &[u8],
14684 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14685 let avail_len = __input.len();
14686 let mut payload_buf = [0; Self::ENCODED_LEN];
14687 let mut buf = if avail_len < Self::ENCODED_LEN {
14688 payload_buf[0..avail_len].copy_from_slice(__input);
14689 Bytes::new(&payload_buf)
14690 } else {
14691 Bytes::new(__input)
14692 };
14693 let mut __struct = Self::default();
14694 __struct.custom_mode = buf.get_u32_le();
14695 __struct.latitude = buf.get_i32_le();
14696 __struct.longitude = buf.get_i32_le();
14697 __struct.roll = buf.get_i16_le();
14698 __struct.pitch = buf.get_i16_le();
14699 __struct.heading = buf.get_u16_le();
14700 __struct.heading_sp = buf.get_i16_le();
14701 __struct.altitude_amsl = buf.get_i16_le();
14702 __struct.altitude_sp = buf.get_i16_le();
14703 __struct.wp_distance = buf.get_u16_le();
14704 let tmp = buf.get_u8();
14705 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14706 ::mavlink_core::error::ParserError::InvalidFlag {
14707 flag_type: "MavModeFlag",
14708 value: tmp as u32,
14709 },
14710 )?;
14711 let tmp = buf.get_u8();
14712 __struct.landed_state =
14713 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14714 enum_type: "MavLandedState",
14715 value: tmp as u32,
14716 })?;
14717 __struct.throttle = buf.get_i8();
14718 __struct.airspeed = buf.get_u8();
14719 __struct.airspeed_sp = buf.get_u8();
14720 __struct.groundspeed = buf.get_u8();
14721 __struct.climb_rate = buf.get_i8();
14722 __struct.gps_nsat = buf.get_u8();
14723 let tmp = buf.get_u8();
14724 __struct.gps_fix_type =
14725 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14726 enum_type: "GpsFixType",
14727 value: tmp as u32,
14728 })?;
14729 __struct.battery_remaining = buf.get_u8();
14730 __struct.temperature = buf.get_i8();
14731 __struct.temperature_air = buf.get_i8();
14732 __struct.failsafe = buf.get_u8();
14733 __struct.wp_num = buf.get_u8();
14734 Ok(__struct)
14735 }
14736 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14737 let mut __tmp = BytesMut::new(bytes);
14738 #[allow(clippy::absurd_extreme_comparisons)]
14739 #[allow(unused_comparisons)]
14740 if __tmp.remaining() < Self::ENCODED_LEN {
14741 panic!(
14742 "buffer is too small (need {} bytes, but got {})",
14743 Self::ENCODED_LEN,
14744 __tmp.remaining(),
14745 )
14746 }
14747 __tmp.put_u32_le(self.custom_mode);
14748 __tmp.put_i32_le(self.latitude);
14749 __tmp.put_i32_le(self.longitude);
14750 __tmp.put_i16_le(self.roll);
14751 __tmp.put_i16_le(self.pitch);
14752 __tmp.put_u16_le(self.heading);
14753 __tmp.put_i16_le(self.heading_sp);
14754 __tmp.put_i16_le(self.altitude_amsl);
14755 __tmp.put_i16_le(self.altitude_sp);
14756 __tmp.put_u16_le(self.wp_distance);
14757 __tmp.put_u8(self.base_mode.bits());
14758 __tmp.put_u8(self.landed_state as u8);
14759 __tmp.put_i8(self.throttle);
14760 __tmp.put_u8(self.airspeed);
14761 __tmp.put_u8(self.airspeed_sp);
14762 __tmp.put_u8(self.groundspeed);
14763 __tmp.put_i8(self.climb_rate);
14764 __tmp.put_u8(self.gps_nsat);
14765 __tmp.put_u8(self.gps_fix_type as u8);
14766 __tmp.put_u8(self.battery_remaining);
14767 __tmp.put_i8(self.temperature);
14768 __tmp.put_i8(self.temperature_air);
14769 __tmp.put_u8(self.failsafe);
14770 __tmp.put_u8(self.wp_num);
14771 if matches!(version, MavlinkVersion::V2) {
14772 let len = __tmp.len();
14773 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14774 } else {
14775 __tmp.len()
14776 }
14777 }
14778}
14779#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
14780#[doc = ""]
14781#[doc = "ID: 235"]
14782#[derive(Debug, Clone, PartialEq)]
14783#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14784#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14785pub struct HIGH_LATENCY2_DATA {
14786 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
14787 pub timestamp: u32,
14788 #[doc = "Latitude"]
14789 pub latitude: i32,
14790 #[doc = "Longitude"]
14791 pub longitude: i32,
14792 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
14793 pub custom_mode: u16,
14794 #[doc = "Altitude above mean sea level"]
14795 pub altitude: i16,
14796 #[doc = "Altitude setpoint"]
14797 pub target_altitude: i16,
14798 #[doc = "Distance to target waypoint or position"]
14799 pub target_distance: u16,
14800 #[doc = "Current waypoint number"]
14801 pub wp_num: u16,
14802 #[doc = "Bitmap of failure flags."]
14803 pub failure_flags: HlFailureFlag,
14804 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
14805 pub mavtype: MavType,
14806 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14807 pub autopilot: MavAutopilot,
14808 #[doc = "Heading"]
14809 pub heading: u8,
14810 #[doc = "Heading setpoint"]
14811 pub target_heading: u8,
14812 #[doc = "Throttle"]
14813 pub throttle: u8,
14814 #[doc = "Airspeed"]
14815 pub airspeed: u8,
14816 #[doc = "Airspeed setpoint"]
14817 pub airspeed_sp: u8,
14818 #[doc = "Groundspeed"]
14819 pub groundspeed: u8,
14820 #[doc = "Windspeed"]
14821 pub windspeed: u8,
14822 #[doc = "Wind heading"]
14823 pub wind_heading: u8,
14824 #[doc = "Maximum error horizontal position since last message"]
14825 pub eph: u8,
14826 #[doc = "Maximum error vertical position since last message"]
14827 pub epv: u8,
14828 #[doc = "Air temperature"]
14829 pub temperature_air: i8,
14830 #[doc = "Maximum climb rate magnitude since last message"]
14831 pub climb_rate: i8,
14832 #[doc = "Battery level (-1 if field not provided)."]
14833 pub battery: i8,
14834 #[doc = "Field for custom payload."]
14835 pub custom0: i8,
14836 #[doc = "Field for custom payload."]
14837 pub custom1: i8,
14838 #[doc = "Field for custom payload."]
14839 pub custom2: i8,
14840}
14841impl HIGH_LATENCY2_DATA {
14842 pub const ENCODED_LEN: usize = 42usize;
14843 pub const DEFAULT: Self = Self {
14844 timestamp: 0_u32,
14845 latitude: 0_i32,
14846 longitude: 0_i32,
14847 custom_mode: 0_u16,
14848 altitude: 0_i16,
14849 target_altitude: 0_i16,
14850 target_distance: 0_u16,
14851 wp_num: 0_u16,
14852 failure_flags: HlFailureFlag::DEFAULT,
14853 mavtype: MavType::DEFAULT,
14854 autopilot: MavAutopilot::DEFAULT,
14855 heading: 0_u8,
14856 target_heading: 0_u8,
14857 throttle: 0_u8,
14858 airspeed: 0_u8,
14859 airspeed_sp: 0_u8,
14860 groundspeed: 0_u8,
14861 windspeed: 0_u8,
14862 wind_heading: 0_u8,
14863 eph: 0_u8,
14864 epv: 0_u8,
14865 temperature_air: 0_i8,
14866 climb_rate: 0_i8,
14867 battery: 0_i8,
14868 custom0: 0_i8,
14869 custom1: 0_i8,
14870 custom2: 0_i8,
14871 };
14872 #[cfg(feature = "arbitrary")]
14873 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14874 use arbitrary::{Arbitrary, Unstructured};
14875 let mut buf = [0u8; 1024];
14876 rng.fill_bytes(&mut buf);
14877 let mut unstructured = Unstructured::new(&buf);
14878 Self::arbitrary(&mut unstructured).unwrap_or_default()
14879 }
14880}
14881impl Default for HIGH_LATENCY2_DATA {
14882 fn default() -> Self {
14883 Self::DEFAULT.clone()
14884 }
14885}
14886impl MessageData for HIGH_LATENCY2_DATA {
14887 type Message = MavMessage;
14888 const ID: u32 = 235u32;
14889 const NAME: &'static str = "HIGH_LATENCY2";
14890 const EXTRA_CRC: u8 = 179u8;
14891 const ENCODED_LEN: usize = 42usize;
14892 fn deser(
14893 _version: MavlinkVersion,
14894 __input: &[u8],
14895 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14896 let avail_len = __input.len();
14897 let mut payload_buf = [0; Self::ENCODED_LEN];
14898 let mut buf = if avail_len < Self::ENCODED_LEN {
14899 payload_buf[0..avail_len].copy_from_slice(__input);
14900 Bytes::new(&payload_buf)
14901 } else {
14902 Bytes::new(__input)
14903 };
14904 let mut __struct = Self::default();
14905 __struct.timestamp = buf.get_u32_le();
14906 __struct.latitude = buf.get_i32_le();
14907 __struct.longitude = buf.get_i32_le();
14908 __struct.custom_mode = buf.get_u16_le();
14909 __struct.altitude = buf.get_i16_le();
14910 __struct.target_altitude = buf.get_i16_le();
14911 __struct.target_distance = buf.get_u16_le();
14912 __struct.wp_num = buf.get_u16_le();
14913 let tmp = buf.get_u16_le();
14914 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
14915 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14916 flag_type: "HlFailureFlag",
14917 value: tmp as u32,
14918 })?;
14919 let tmp = buf.get_u8();
14920 __struct.mavtype =
14921 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14922 enum_type: "MavType",
14923 value: tmp as u32,
14924 })?;
14925 let tmp = buf.get_u8();
14926 __struct.autopilot =
14927 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14928 enum_type: "MavAutopilot",
14929 value: tmp as u32,
14930 })?;
14931 __struct.heading = buf.get_u8();
14932 __struct.target_heading = buf.get_u8();
14933 __struct.throttle = buf.get_u8();
14934 __struct.airspeed = buf.get_u8();
14935 __struct.airspeed_sp = buf.get_u8();
14936 __struct.groundspeed = buf.get_u8();
14937 __struct.windspeed = buf.get_u8();
14938 __struct.wind_heading = buf.get_u8();
14939 __struct.eph = buf.get_u8();
14940 __struct.epv = buf.get_u8();
14941 __struct.temperature_air = buf.get_i8();
14942 __struct.climb_rate = buf.get_i8();
14943 __struct.battery = buf.get_i8();
14944 __struct.custom0 = buf.get_i8();
14945 __struct.custom1 = buf.get_i8();
14946 __struct.custom2 = buf.get_i8();
14947 Ok(__struct)
14948 }
14949 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14950 let mut __tmp = BytesMut::new(bytes);
14951 #[allow(clippy::absurd_extreme_comparisons)]
14952 #[allow(unused_comparisons)]
14953 if __tmp.remaining() < Self::ENCODED_LEN {
14954 panic!(
14955 "buffer is too small (need {} bytes, but got {})",
14956 Self::ENCODED_LEN,
14957 __tmp.remaining(),
14958 )
14959 }
14960 __tmp.put_u32_le(self.timestamp);
14961 __tmp.put_i32_le(self.latitude);
14962 __tmp.put_i32_le(self.longitude);
14963 __tmp.put_u16_le(self.custom_mode);
14964 __tmp.put_i16_le(self.altitude);
14965 __tmp.put_i16_le(self.target_altitude);
14966 __tmp.put_u16_le(self.target_distance);
14967 __tmp.put_u16_le(self.wp_num);
14968 __tmp.put_u16_le(self.failure_flags.bits());
14969 __tmp.put_u8(self.mavtype as u8);
14970 __tmp.put_u8(self.autopilot as u8);
14971 __tmp.put_u8(self.heading);
14972 __tmp.put_u8(self.target_heading);
14973 __tmp.put_u8(self.throttle);
14974 __tmp.put_u8(self.airspeed);
14975 __tmp.put_u8(self.airspeed_sp);
14976 __tmp.put_u8(self.groundspeed);
14977 __tmp.put_u8(self.windspeed);
14978 __tmp.put_u8(self.wind_heading);
14979 __tmp.put_u8(self.eph);
14980 __tmp.put_u8(self.epv);
14981 __tmp.put_i8(self.temperature_air);
14982 __tmp.put_i8(self.climb_rate);
14983 __tmp.put_i8(self.battery);
14984 __tmp.put_i8(self.custom0);
14985 __tmp.put_i8(self.custom1);
14986 __tmp.put_i8(self.custom2);
14987 if matches!(version, MavlinkVersion::V2) {
14988 let len = __tmp.len();
14989 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14990 } else {
14991 __tmp.len()
14992 }
14993 }
14994}
14995#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
14996#[doc = ""]
14997#[doc = "ID: 93"]
14998#[derive(Debug, Clone, PartialEq)]
14999#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15000#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15001pub struct HIL_ACTUATOR_CONTROLS_DATA {
15002 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15003 pub time_usec: u64,
15004 #[doc = "Flags bitmask."]
15005 pub flags: HilActuatorControlsFlags,
15006 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15007 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15008 pub controls: [f32; 16],
15009 #[doc = "System mode. Includes arming state."]
15010 pub mode: MavModeFlag,
15011}
15012impl HIL_ACTUATOR_CONTROLS_DATA {
15013 pub const ENCODED_LEN: usize = 81usize;
15014 pub const DEFAULT: Self = Self {
15015 time_usec: 0_u64,
15016 flags: HilActuatorControlsFlags::DEFAULT,
15017 controls: [0.0_f32; 16usize],
15018 mode: MavModeFlag::DEFAULT,
15019 };
15020 #[cfg(feature = "arbitrary")]
15021 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15022 use arbitrary::{Arbitrary, Unstructured};
15023 let mut buf = [0u8; 1024];
15024 rng.fill_bytes(&mut buf);
15025 let mut unstructured = Unstructured::new(&buf);
15026 Self::arbitrary(&mut unstructured).unwrap_or_default()
15027 }
15028}
15029impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15030 fn default() -> Self {
15031 Self::DEFAULT.clone()
15032 }
15033}
15034impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15035 type Message = MavMessage;
15036 const ID: u32 = 93u32;
15037 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15038 const EXTRA_CRC: u8 = 47u8;
15039 const ENCODED_LEN: usize = 81usize;
15040 fn deser(
15041 _version: MavlinkVersion,
15042 __input: &[u8],
15043 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15044 let avail_len = __input.len();
15045 let mut payload_buf = [0; Self::ENCODED_LEN];
15046 let mut buf = if avail_len < Self::ENCODED_LEN {
15047 payload_buf[0..avail_len].copy_from_slice(__input);
15048 Bytes::new(&payload_buf)
15049 } else {
15050 Bytes::new(__input)
15051 };
15052 let mut __struct = Self::default();
15053 __struct.time_usec = buf.get_u64_le();
15054 let tmp = buf.get_u64_le();
15055 __struct.flags =
15056 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
15057 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15058 flag_type: "HilActuatorControlsFlags",
15059 value: tmp as u32,
15060 })?;
15061 for v in &mut __struct.controls {
15062 let val = buf.get_f32_le();
15063 *v = val;
15064 }
15065 let tmp = buf.get_u8();
15066 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15067 ::mavlink_core::error::ParserError::InvalidFlag {
15068 flag_type: "MavModeFlag",
15069 value: tmp as u32,
15070 },
15071 )?;
15072 Ok(__struct)
15073 }
15074 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15075 let mut __tmp = BytesMut::new(bytes);
15076 #[allow(clippy::absurd_extreme_comparisons)]
15077 #[allow(unused_comparisons)]
15078 if __tmp.remaining() < Self::ENCODED_LEN {
15079 panic!(
15080 "buffer is too small (need {} bytes, but got {})",
15081 Self::ENCODED_LEN,
15082 __tmp.remaining(),
15083 )
15084 }
15085 __tmp.put_u64_le(self.time_usec);
15086 __tmp.put_u64_le(self.flags.bits());
15087 for val in &self.controls {
15088 __tmp.put_f32_le(*val);
15089 }
15090 __tmp.put_u8(self.mode.bits());
15091 if matches!(version, MavlinkVersion::V2) {
15092 let len = __tmp.len();
15093 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15094 } else {
15095 __tmp.len()
15096 }
15097 }
15098}
15099#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15100#[doc = ""]
15101#[doc = "ID: 91"]
15102#[derive(Debug, Clone, PartialEq)]
15103#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15104#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15105pub struct HIL_CONTROLS_DATA {
15106 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15107 pub time_usec: u64,
15108 #[doc = "Control output -1 .. 1"]
15109 pub roll_ailerons: f32,
15110 #[doc = "Control output -1 .. 1"]
15111 pub pitch_elevator: f32,
15112 #[doc = "Control output -1 .. 1"]
15113 pub yaw_rudder: f32,
15114 #[doc = "Throttle 0 .. 1"]
15115 pub throttle: f32,
15116 #[doc = "Aux 1, -1 .. 1"]
15117 pub aux1: f32,
15118 #[doc = "Aux 2, -1 .. 1"]
15119 pub aux2: f32,
15120 #[doc = "Aux 3, -1 .. 1"]
15121 pub aux3: f32,
15122 #[doc = "Aux 4, -1 .. 1"]
15123 pub aux4: f32,
15124 #[doc = "System mode."]
15125 pub mode: MavMode,
15126 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15127 pub nav_mode: u8,
15128}
15129impl HIL_CONTROLS_DATA {
15130 pub const ENCODED_LEN: usize = 42usize;
15131 pub const DEFAULT: Self = Self {
15132 time_usec: 0_u64,
15133 roll_ailerons: 0.0_f32,
15134 pitch_elevator: 0.0_f32,
15135 yaw_rudder: 0.0_f32,
15136 throttle: 0.0_f32,
15137 aux1: 0.0_f32,
15138 aux2: 0.0_f32,
15139 aux3: 0.0_f32,
15140 aux4: 0.0_f32,
15141 mode: MavMode::DEFAULT,
15142 nav_mode: 0_u8,
15143 };
15144 #[cfg(feature = "arbitrary")]
15145 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15146 use arbitrary::{Arbitrary, Unstructured};
15147 let mut buf = [0u8; 1024];
15148 rng.fill_bytes(&mut buf);
15149 let mut unstructured = Unstructured::new(&buf);
15150 Self::arbitrary(&mut unstructured).unwrap_or_default()
15151 }
15152}
15153impl Default for HIL_CONTROLS_DATA {
15154 fn default() -> Self {
15155 Self::DEFAULT.clone()
15156 }
15157}
15158impl MessageData for HIL_CONTROLS_DATA {
15159 type Message = MavMessage;
15160 const ID: u32 = 91u32;
15161 const NAME: &'static str = "HIL_CONTROLS";
15162 const EXTRA_CRC: u8 = 63u8;
15163 const ENCODED_LEN: usize = 42usize;
15164 fn deser(
15165 _version: MavlinkVersion,
15166 __input: &[u8],
15167 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15168 let avail_len = __input.len();
15169 let mut payload_buf = [0; Self::ENCODED_LEN];
15170 let mut buf = if avail_len < Self::ENCODED_LEN {
15171 payload_buf[0..avail_len].copy_from_slice(__input);
15172 Bytes::new(&payload_buf)
15173 } else {
15174 Bytes::new(__input)
15175 };
15176 let mut __struct = Self::default();
15177 __struct.time_usec = buf.get_u64_le();
15178 __struct.roll_ailerons = buf.get_f32_le();
15179 __struct.pitch_elevator = buf.get_f32_le();
15180 __struct.yaw_rudder = buf.get_f32_le();
15181 __struct.throttle = buf.get_f32_le();
15182 __struct.aux1 = buf.get_f32_le();
15183 __struct.aux2 = buf.get_f32_le();
15184 __struct.aux3 = buf.get_f32_le();
15185 __struct.aux4 = buf.get_f32_le();
15186 let tmp = buf.get_u8();
15187 __struct.mode =
15188 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15189 enum_type: "MavMode",
15190 value: tmp as u32,
15191 })?;
15192 __struct.nav_mode = buf.get_u8();
15193 Ok(__struct)
15194 }
15195 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15196 let mut __tmp = BytesMut::new(bytes);
15197 #[allow(clippy::absurd_extreme_comparisons)]
15198 #[allow(unused_comparisons)]
15199 if __tmp.remaining() < Self::ENCODED_LEN {
15200 panic!(
15201 "buffer is too small (need {} bytes, but got {})",
15202 Self::ENCODED_LEN,
15203 __tmp.remaining(),
15204 )
15205 }
15206 __tmp.put_u64_le(self.time_usec);
15207 __tmp.put_f32_le(self.roll_ailerons);
15208 __tmp.put_f32_le(self.pitch_elevator);
15209 __tmp.put_f32_le(self.yaw_rudder);
15210 __tmp.put_f32_le(self.throttle);
15211 __tmp.put_f32_le(self.aux1);
15212 __tmp.put_f32_le(self.aux2);
15213 __tmp.put_f32_le(self.aux3);
15214 __tmp.put_f32_le(self.aux4);
15215 __tmp.put_u8(self.mode as u8);
15216 __tmp.put_u8(self.nav_mode);
15217 if matches!(version, MavlinkVersion::V2) {
15218 let len = __tmp.len();
15219 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15220 } else {
15221 __tmp.len()
15222 }
15223 }
15224}
15225#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15226#[doc = ""]
15227#[doc = "ID: 113"]
15228#[derive(Debug, Clone, PartialEq)]
15229#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15230#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15231pub struct HIL_GPS_DATA {
15232 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15233 pub time_usec: u64,
15234 #[doc = "Latitude (WGS84)"]
15235 pub lat: i32,
15236 #[doc = "Longitude (WGS84)"]
15237 pub lon: i32,
15238 #[doc = "Altitude (MSL). Positive for up."]
15239 pub alt: i32,
15240 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15241 pub eph: u16,
15242 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15243 pub epv: u16,
15244 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15245 pub vel: u16,
15246 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15247 pub vn: i16,
15248 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15249 pub ve: i16,
15250 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15251 pub vd: i16,
15252 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15253 pub cog: u16,
15254 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
15255 pub fix_type: u8,
15256 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15257 pub satellites_visible: u8,
15258 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
15259 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15260 pub id: u8,
15261 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15262 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15263 pub yaw: u16,
15264}
15265impl HIL_GPS_DATA {
15266 pub const ENCODED_LEN: usize = 39usize;
15267 pub const DEFAULT: Self = Self {
15268 time_usec: 0_u64,
15269 lat: 0_i32,
15270 lon: 0_i32,
15271 alt: 0_i32,
15272 eph: 0_u16,
15273 epv: 0_u16,
15274 vel: 0_u16,
15275 vn: 0_i16,
15276 ve: 0_i16,
15277 vd: 0_i16,
15278 cog: 0_u16,
15279 fix_type: 0_u8,
15280 satellites_visible: 0_u8,
15281 id: 0_u8,
15282 yaw: 0_u16,
15283 };
15284 #[cfg(feature = "arbitrary")]
15285 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15286 use arbitrary::{Arbitrary, Unstructured};
15287 let mut buf = [0u8; 1024];
15288 rng.fill_bytes(&mut buf);
15289 let mut unstructured = Unstructured::new(&buf);
15290 Self::arbitrary(&mut unstructured).unwrap_or_default()
15291 }
15292}
15293impl Default for HIL_GPS_DATA {
15294 fn default() -> Self {
15295 Self::DEFAULT.clone()
15296 }
15297}
15298impl MessageData for HIL_GPS_DATA {
15299 type Message = MavMessage;
15300 const ID: u32 = 113u32;
15301 const NAME: &'static str = "HIL_GPS";
15302 const EXTRA_CRC: u8 = 124u8;
15303 const ENCODED_LEN: usize = 39usize;
15304 fn deser(
15305 _version: MavlinkVersion,
15306 __input: &[u8],
15307 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15308 let avail_len = __input.len();
15309 let mut payload_buf = [0; Self::ENCODED_LEN];
15310 let mut buf = if avail_len < Self::ENCODED_LEN {
15311 payload_buf[0..avail_len].copy_from_slice(__input);
15312 Bytes::new(&payload_buf)
15313 } else {
15314 Bytes::new(__input)
15315 };
15316 let mut __struct = Self::default();
15317 __struct.time_usec = buf.get_u64_le();
15318 __struct.lat = buf.get_i32_le();
15319 __struct.lon = buf.get_i32_le();
15320 __struct.alt = buf.get_i32_le();
15321 __struct.eph = buf.get_u16_le();
15322 __struct.epv = buf.get_u16_le();
15323 __struct.vel = buf.get_u16_le();
15324 __struct.vn = buf.get_i16_le();
15325 __struct.ve = buf.get_i16_le();
15326 __struct.vd = buf.get_i16_le();
15327 __struct.cog = buf.get_u16_le();
15328 __struct.fix_type = buf.get_u8();
15329 __struct.satellites_visible = buf.get_u8();
15330 __struct.id = buf.get_u8();
15331 __struct.yaw = buf.get_u16_le();
15332 Ok(__struct)
15333 }
15334 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15335 let mut __tmp = BytesMut::new(bytes);
15336 #[allow(clippy::absurd_extreme_comparisons)]
15337 #[allow(unused_comparisons)]
15338 if __tmp.remaining() < Self::ENCODED_LEN {
15339 panic!(
15340 "buffer is too small (need {} bytes, but got {})",
15341 Self::ENCODED_LEN,
15342 __tmp.remaining(),
15343 )
15344 }
15345 __tmp.put_u64_le(self.time_usec);
15346 __tmp.put_i32_le(self.lat);
15347 __tmp.put_i32_le(self.lon);
15348 __tmp.put_i32_le(self.alt);
15349 __tmp.put_u16_le(self.eph);
15350 __tmp.put_u16_le(self.epv);
15351 __tmp.put_u16_le(self.vel);
15352 __tmp.put_i16_le(self.vn);
15353 __tmp.put_i16_le(self.ve);
15354 __tmp.put_i16_le(self.vd);
15355 __tmp.put_u16_le(self.cog);
15356 __tmp.put_u8(self.fix_type);
15357 __tmp.put_u8(self.satellites_visible);
15358 if matches!(version, MavlinkVersion::V2) {
15359 __tmp.put_u8(self.id);
15360 __tmp.put_u16_le(self.yaw);
15361 let len = __tmp.len();
15362 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15363 } else {
15364 __tmp.len()
15365 }
15366 }
15367}
15368#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
15369#[doc = ""]
15370#[doc = "ID: 114"]
15371#[derive(Debug, Clone, PartialEq)]
15372#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15373#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15374pub struct HIL_OPTICAL_FLOW_DATA {
15375 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15376 pub time_usec: u64,
15377 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
15378 pub integration_time_us: u32,
15379 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
15380 pub integrated_x: f32,
15381 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
15382 pub integrated_y: f32,
15383 #[doc = "RH rotation around X axis"]
15384 pub integrated_xgyro: f32,
15385 #[doc = "RH rotation around Y axis"]
15386 pub integrated_ygyro: f32,
15387 #[doc = "RH rotation around Z axis"]
15388 pub integrated_zgyro: f32,
15389 #[doc = "Time since the distance was sampled."]
15390 pub time_delta_distance_us: u32,
15391 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
15392 pub distance: f32,
15393 #[doc = "Temperature"]
15394 pub temperature: i16,
15395 #[doc = "Sensor ID"]
15396 pub sensor_id: u8,
15397 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
15398 pub quality: u8,
15399}
15400impl HIL_OPTICAL_FLOW_DATA {
15401 pub const ENCODED_LEN: usize = 44usize;
15402 pub const DEFAULT: Self = Self {
15403 time_usec: 0_u64,
15404 integration_time_us: 0_u32,
15405 integrated_x: 0.0_f32,
15406 integrated_y: 0.0_f32,
15407 integrated_xgyro: 0.0_f32,
15408 integrated_ygyro: 0.0_f32,
15409 integrated_zgyro: 0.0_f32,
15410 time_delta_distance_us: 0_u32,
15411 distance: 0.0_f32,
15412 temperature: 0_i16,
15413 sensor_id: 0_u8,
15414 quality: 0_u8,
15415 };
15416 #[cfg(feature = "arbitrary")]
15417 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15418 use arbitrary::{Arbitrary, Unstructured};
15419 let mut buf = [0u8; 1024];
15420 rng.fill_bytes(&mut buf);
15421 let mut unstructured = Unstructured::new(&buf);
15422 Self::arbitrary(&mut unstructured).unwrap_or_default()
15423 }
15424}
15425impl Default for HIL_OPTICAL_FLOW_DATA {
15426 fn default() -> Self {
15427 Self::DEFAULT.clone()
15428 }
15429}
15430impl MessageData for HIL_OPTICAL_FLOW_DATA {
15431 type Message = MavMessage;
15432 const ID: u32 = 114u32;
15433 const NAME: &'static str = "HIL_OPTICAL_FLOW";
15434 const EXTRA_CRC: u8 = 237u8;
15435 const ENCODED_LEN: usize = 44usize;
15436 fn deser(
15437 _version: MavlinkVersion,
15438 __input: &[u8],
15439 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15440 let avail_len = __input.len();
15441 let mut payload_buf = [0; Self::ENCODED_LEN];
15442 let mut buf = if avail_len < Self::ENCODED_LEN {
15443 payload_buf[0..avail_len].copy_from_slice(__input);
15444 Bytes::new(&payload_buf)
15445 } else {
15446 Bytes::new(__input)
15447 };
15448 let mut __struct = Self::default();
15449 __struct.time_usec = buf.get_u64_le();
15450 __struct.integration_time_us = buf.get_u32_le();
15451 __struct.integrated_x = buf.get_f32_le();
15452 __struct.integrated_y = buf.get_f32_le();
15453 __struct.integrated_xgyro = buf.get_f32_le();
15454 __struct.integrated_ygyro = buf.get_f32_le();
15455 __struct.integrated_zgyro = buf.get_f32_le();
15456 __struct.time_delta_distance_us = buf.get_u32_le();
15457 __struct.distance = buf.get_f32_le();
15458 __struct.temperature = buf.get_i16_le();
15459 __struct.sensor_id = buf.get_u8();
15460 __struct.quality = buf.get_u8();
15461 Ok(__struct)
15462 }
15463 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15464 let mut __tmp = BytesMut::new(bytes);
15465 #[allow(clippy::absurd_extreme_comparisons)]
15466 #[allow(unused_comparisons)]
15467 if __tmp.remaining() < Self::ENCODED_LEN {
15468 panic!(
15469 "buffer is too small (need {} bytes, but got {})",
15470 Self::ENCODED_LEN,
15471 __tmp.remaining(),
15472 )
15473 }
15474 __tmp.put_u64_le(self.time_usec);
15475 __tmp.put_u32_le(self.integration_time_us);
15476 __tmp.put_f32_le(self.integrated_x);
15477 __tmp.put_f32_le(self.integrated_y);
15478 __tmp.put_f32_le(self.integrated_xgyro);
15479 __tmp.put_f32_le(self.integrated_ygyro);
15480 __tmp.put_f32_le(self.integrated_zgyro);
15481 __tmp.put_u32_le(self.time_delta_distance_us);
15482 __tmp.put_f32_le(self.distance);
15483 __tmp.put_i16_le(self.temperature);
15484 __tmp.put_u8(self.sensor_id);
15485 __tmp.put_u8(self.quality);
15486 if matches!(version, MavlinkVersion::V2) {
15487 let len = __tmp.len();
15488 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15489 } else {
15490 __tmp.len()
15491 }
15492 }
15493}
15494#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
15495#[doc = ""]
15496#[doc = "ID: 92"]
15497#[derive(Debug, Clone, PartialEq)]
15498#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15500pub struct HIL_RC_INPUTS_RAW_DATA {
15501 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15502 pub time_usec: u64,
15503 #[doc = "RC channel 1 value"]
15504 pub chan1_raw: u16,
15505 #[doc = "RC channel 2 value"]
15506 pub chan2_raw: u16,
15507 #[doc = "RC channel 3 value"]
15508 pub chan3_raw: u16,
15509 #[doc = "RC channel 4 value"]
15510 pub chan4_raw: u16,
15511 #[doc = "RC channel 5 value"]
15512 pub chan5_raw: u16,
15513 #[doc = "RC channel 6 value"]
15514 pub chan6_raw: u16,
15515 #[doc = "RC channel 7 value"]
15516 pub chan7_raw: u16,
15517 #[doc = "RC channel 8 value"]
15518 pub chan8_raw: u16,
15519 #[doc = "RC channel 9 value"]
15520 pub chan9_raw: u16,
15521 #[doc = "RC channel 10 value"]
15522 pub chan10_raw: u16,
15523 #[doc = "RC channel 11 value"]
15524 pub chan11_raw: u16,
15525 #[doc = "RC channel 12 value"]
15526 pub chan12_raw: u16,
15527 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
15528 pub rssi: u8,
15529}
15530impl HIL_RC_INPUTS_RAW_DATA {
15531 pub const ENCODED_LEN: usize = 33usize;
15532 pub const DEFAULT: Self = Self {
15533 time_usec: 0_u64,
15534 chan1_raw: 0_u16,
15535 chan2_raw: 0_u16,
15536 chan3_raw: 0_u16,
15537 chan4_raw: 0_u16,
15538 chan5_raw: 0_u16,
15539 chan6_raw: 0_u16,
15540 chan7_raw: 0_u16,
15541 chan8_raw: 0_u16,
15542 chan9_raw: 0_u16,
15543 chan10_raw: 0_u16,
15544 chan11_raw: 0_u16,
15545 chan12_raw: 0_u16,
15546 rssi: 0_u8,
15547 };
15548 #[cfg(feature = "arbitrary")]
15549 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15550 use arbitrary::{Arbitrary, Unstructured};
15551 let mut buf = [0u8; 1024];
15552 rng.fill_bytes(&mut buf);
15553 let mut unstructured = Unstructured::new(&buf);
15554 Self::arbitrary(&mut unstructured).unwrap_or_default()
15555 }
15556}
15557impl Default for HIL_RC_INPUTS_RAW_DATA {
15558 fn default() -> Self {
15559 Self::DEFAULT.clone()
15560 }
15561}
15562impl MessageData for HIL_RC_INPUTS_RAW_DATA {
15563 type Message = MavMessage;
15564 const ID: u32 = 92u32;
15565 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
15566 const EXTRA_CRC: u8 = 54u8;
15567 const ENCODED_LEN: usize = 33usize;
15568 fn deser(
15569 _version: MavlinkVersion,
15570 __input: &[u8],
15571 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15572 let avail_len = __input.len();
15573 let mut payload_buf = [0; Self::ENCODED_LEN];
15574 let mut buf = if avail_len < Self::ENCODED_LEN {
15575 payload_buf[0..avail_len].copy_from_slice(__input);
15576 Bytes::new(&payload_buf)
15577 } else {
15578 Bytes::new(__input)
15579 };
15580 let mut __struct = Self::default();
15581 __struct.time_usec = buf.get_u64_le();
15582 __struct.chan1_raw = buf.get_u16_le();
15583 __struct.chan2_raw = buf.get_u16_le();
15584 __struct.chan3_raw = buf.get_u16_le();
15585 __struct.chan4_raw = buf.get_u16_le();
15586 __struct.chan5_raw = buf.get_u16_le();
15587 __struct.chan6_raw = buf.get_u16_le();
15588 __struct.chan7_raw = buf.get_u16_le();
15589 __struct.chan8_raw = buf.get_u16_le();
15590 __struct.chan9_raw = buf.get_u16_le();
15591 __struct.chan10_raw = buf.get_u16_le();
15592 __struct.chan11_raw = buf.get_u16_le();
15593 __struct.chan12_raw = buf.get_u16_le();
15594 __struct.rssi = buf.get_u8();
15595 Ok(__struct)
15596 }
15597 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15598 let mut __tmp = BytesMut::new(bytes);
15599 #[allow(clippy::absurd_extreme_comparisons)]
15600 #[allow(unused_comparisons)]
15601 if __tmp.remaining() < Self::ENCODED_LEN {
15602 panic!(
15603 "buffer is too small (need {} bytes, but got {})",
15604 Self::ENCODED_LEN,
15605 __tmp.remaining(),
15606 )
15607 }
15608 __tmp.put_u64_le(self.time_usec);
15609 __tmp.put_u16_le(self.chan1_raw);
15610 __tmp.put_u16_le(self.chan2_raw);
15611 __tmp.put_u16_le(self.chan3_raw);
15612 __tmp.put_u16_le(self.chan4_raw);
15613 __tmp.put_u16_le(self.chan5_raw);
15614 __tmp.put_u16_le(self.chan6_raw);
15615 __tmp.put_u16_le(self.chan7_raw);
15616 __tmp.put_u16_le(self.chan8_raw);
15617 __tmp.put_u16_le(self.chan9_raw);
15618 __tmp.put_u16_le(self.chan10_raw);
15619 __tmp.put_u16_le(self.chan11_raw);
15620 __tmp.put_u16_le(self.chan12_raw);
15621 __tmp.put_u8(self.rssi);
15622 if matches!(version, MavlinkVersion::V2) {
15623 let len = __tmp.len();
15624 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15625 } else {
15626 __tmp.len()
15627 }
15628 }
15629}
15630#[doc = "The IMU readings in SI units in NED body frame."]
15631#[doc = ""]
15632#[doc = "ID: 107"]
15633#[derive(Debug, Clone, PartialEq)]
15634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15635#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15636pub struct HIL_SENSOR_DATA {
15637 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15638 pub time_usec: u64,
15639 #[doc = "X acceleration"]
15640 pub xacc: f32,
15641 #[doc = "Y acceleration"]
15642 pub yacc: f32,
15643 #[doc = "Z acceleration"]
15644 pub zacc: f32,
15645 #[doc = "Angular speed around X axis in body frame"]
15646 pub xgyro: f32,
15647 #[doc = "Angular speed around Y axis in body frame"]
15648 pub ygyro: f32,
15649 #[doc = "Angular speed around Z axis in body frame"]
15650 pub zgyro: f32,
15651 #[doc = "X Magnetic field"]
15652 pub xmag: f32,
15653 #[doc = "Y Magnetic field"]
15654 pub ymag: f32,
15655 #[doc = "Z Magnetic field"]
15656 pub zmag: f32,
15657 #[doc = "Absolute pressure"]
15658 pub abs_pressure: f32,
15659 #[doc = "Differential pressure (airspeed)"]
15660 pub diff_pressure: f32,
15661 #[doc = "Altitude calculated from pressure"]
15662 pub pressure_alt: f32,
15663 #[doc = "Temperature"]
15664 pub temperature: f32,
15665 #[doc = "Bitmap for fields that have updated since last message"]
15666 pub fields_updated: HilSensorUpdatedFlags,
15667 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
15668 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15669 pub id: u8,
15670}
15671impl HIL_SENSOR_DATA {
15672 pub const ENCODED_LEN: usize = 65usize;
15673 pub const DEFAULT: Self = Self {
15674 time_usec: 0_u64,
15675 xacc: 0.0_f32,
15676 yacc: 0.0_f32,
15677 zacc: 0.0_f32,
15678 xgyro: 0.0_f32,
15679 ygyro: 0.0_f32,
15680 zgyro: 0.0_f32,
15681 xmag: 0.0_f32,
15682 ymag: 0.0_f32,
15683 zmag: 0.0_f32,
15684 abs_pressure: 0.0_f32,
15685 diff_pressure: 0.0_f32,
15686 pressure_alt: 0.0_f32,
15687 temperature: 0.0_f32,
15688 fields_updated: HilSensorUpdatedFlags::DEFAULT,
15689 id: 0_u8,
15690 };
15691 #[cfg(feature = "arbitrary")]
15692 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15693 use arbitrary::{Arbitrary, Unstructured};
15694 let mut buf = [0u8; 1024];
15695 rng.fill_bytes(&mut buf);
15696 let mut unstructured = Unstructured::new(&buf);
15697 Self::arbitrary(&mut unstructured).unwrap_or_default()
15698 }
15699}
15700impl Default for HIL_SENSOR_DATA {
15701 fn default() -> Self {
15702 Self::DEFAULT.clone()
15703 }
15704}
15705impl MessageData for HIL_SENSOR_DATA {
15706 type Message = MavMessage;
15707 const ID: u32 = 107u32;
15708 const NAME: &'static str = "HIL_SENSOR";
15709 const EXTRA_CRC: u8 = 108u8;
15710 const ENCODED_LEN: usize = 65usize;
15711 fn deser(
15712 _version: MavlinkVersion,
15713 __input: &[u8],
15714 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15715 let avail_len = __input.len();
15716 let mut payload_buf = [0; Self::ENCODED_LEN];
15717 let mut buf = if avail_len < Self::ENCODED_LEN {
15718 payload_buf[0..avail_len].copy_from_slice(__input);
15719 Bytes::new(&payload_buf)
15720 } else {
15721 Bytes::new(__input)
15722 };
15723 let mut __struct = Self::default();
15724 __struct.time_usec = buf.get_u64_le();
15725 __struct.xacc = buf.get_f32_le();
15726 __struct.yacc = buf.get_f32_le();
15727 __struct.zacc = buf.get_f32_le();
15728 __struct.xgyro = buf.get_f32_le();
15729 __struct.ygyro = buf.get_f32_le();
15730 __struct.zgyro = buf.get_f32_le();
15731 __struct.xmag = buf.get_f32_le();
15732 __struct.ymag = buf.get_f32_le();
15733 __struct.zmag = buf.get_f32_le();
15734 __struct.abs_pressure = buf.get_f32_le();
15735 __struct.diff_pressure = buf.get_f32_le();
15736 __struct.pressure_alt = buf.get_f32_le();
15737 __struct.temperature = buf.get_f32_le();
15738 let tmp = buf.get_u32_le();
15739 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
15740 tmp & HilSensorUpdatedFlags::all().bits(),
15741 )
15742 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15743 flag_type: "HilSensorUpdatedFlags",
15744 value: tmp as u32,
15745 })?;
15746 __struct.id = buf.get_u8();
15747 Ok(__struct)
15748 }
15749 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15750 let mut __tmp = BytesMut::new(bytes);
15751 #[allow(clippy::absurd_extreme_comparisons)]
15752 #[allow(unused_comparisons)]
15753 if __tmp.remaining() < Self::ENCODED_LEN {
15754 panic!(
15755 "buffer is too small (need {} bytes, but got {})",
15756 Self::ENCODED_LEN,
15757 __tmp.remaining(),
15758 )
15759 }
15760 __tmp.put_u64_le(self.time_usec);
15761 __tmp.put_f32_le(self.xacc);
15762 __tmp.put_f32_le(self.yacc);
15763 __tmp.put_f32_le(self.zacc);
15764 __tmp.put_f32_le(self.xgyro);
15765 __tmp.put_f32_le(self.ygyro);
15766 __tmp.put_f32_le(self.zgyro);
15767 __tmp.put_f32_le(self.xmag);
15768 __tmp.put_f32_le(self.ymag);
15769 __tmp.put_f32_le(self.zmag);
15770 __tmp.put_f32_le(self.abs_pressure);
15771 __tmp.put_f32_le(self.diff_pressure);
15772 __tmp.put_f32_le(self.pressure_alt);
15773 __tmp.put_f32_le(self.temperature);
15774 __tmp.put_u32_le(self.fields_updated.bits());
15775 if matches!(version, MavlinkVersion::V2) {
15776 __tmp.put_u8(self.id);
15777 let len = __tmp.len();
15778 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15779 } else {
15780 __tmp.len()
15781 }
15782 }
15783}
15784#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
15785#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
15786#[doc = ""]
15787#[doc = "ID: 90"]
15788#[derive(Debug, Clone, PartialEq)]
15789#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15790#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15791pub struct HIL_STATE_DATA {
15792 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15793 pub time_usec: u64,
15794 #[doc = "Roll angle"]
15795 pub roll: f32,
15796 #[doc = "Pitch angle"]
15797 pub pitch: f32,
15798 #[doc = "Yaw angle"]
15799 pub yaw: f32,
15800 #[doc = "Body frame roll / phi angular speed"]
15801 pub rollspeed: f32,
15802 #[doc = "Body frame pitch / theta angular speed"]
15803 pub pitchspeed: f32,
15804 #[doc = "Body frame yaw / psi angular speed"]
15805 pub yawspeed: f32,
15806 #[doc = "Latitude"]
15807 pub lat: i32,
15808 #[doc = "Longitude"]
15809 pub lon: i32,
15810 #[doc = "Altitude"]
15811 pub alt: i32,
15812 #[doc = "Ground X Speed (Latitude)"]
15813 pub vx: i16,
15814 #[doc = "Ground Y Speed (Longitude)"]
15815 pub vy: i16,
15816 #[doc = "Ground Z Speed (Altitude)"]
15817 pub vz: i16,
15818 #[doc = "X acceleration"]
15819 pub xacc: i16,
15820 #[doc = "Y acceleration"]
15821 pub yacc: i16,
15822 #[doc = "Z acceleration"]
15823 pub zacc: i16,
15824}
15825impl HIL_STATE_DATA {
15826 pub const ENCODED_LEN: usize = 56usize;
15827 pub const DEFAULT: Self = Self {
15828 time_usec: 0_u64,
15829 roll: 0.0_f32,
15830 pitch: 0.0_f32,
15831 yaw: 0.0_f32,
15832 rollspeed: 0.0_f32,
15833 pitchspeed: 0.0_f32,
15834 yawspeed: 0.0_f32,
15835 lat: 0_i32,
15836 lon: 0_i32,
15837 alt: 0_i32,
15838 vx: 0_i16,
15839 vy: 0_i16,
15840 vz: 0_i16,
15841 xacc: 0_i16,
15842 yacc: 0_i16,
15843 zacc: 0_i16,
15844 };
15845 #[cfg(feature = "arbitrary")]
15846 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15847 use arbitrary::{Arbitrary, Unstructured};
15848 let mut buf = [0u8; 1024];
15849 rng.fill_bytes(&mut buf);
15850 let mut unstructured = Unstructured::new(&buf);
15851 Self::arbitrary(&mut unstructured).unwrap_or_default()
15852 }
15853}
15854impl Default for HIL_STATE_DATA {
15855 fn default() -> Self {
15856 Self::DEFAULT.clone()
15857 }
15858}
15859impl MessageData for HIL_STATE_DATA {
15860 type Message = MavMessage;
15861 const ID: u32 = 90u32;
15862 const NAME: &'static str = "HIL_STATE";
15863 const EXTRA_CRC: u8 = 183u8;
15864 const ENCODED_LEN: usize = 56usize;
15865 fn deser(
15866 _version: MavlinkVersion,
15867 __input: &[u8],
15868 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15869 let avail_len = __input.len();
15870 let mut payload_buf = [0; Self::ENCODED_LEN];
15871 let mut buf = if avail_len < Self::ENCODED_LEN {
15872 payload_buf[0..avail_len].copy_from_slice(__input);
15873 Bytes::new(&payload_buf)
15874 } else {
15875 Bytes::new(__input)
15876 };
15877 let mut __struct = Self::default();
15878 __struct.time_usec = buf.get_u64_le();
15879 __struct.roll = buf.get_f32_le();
15880 __struct.pitch = buf.get_f32_le();
15881 __struct.yaw = buf.get_f32_le();
15882 __struct.rollspeed = buf.get_f32_le();
15883 __struct.pitchspeed = buf.get_f32_le();
15884 __struct.yawspeed = buf.get_f32_le();
15885 __struct.lat = buf.get_i32_le();
15886 __struct.lon = buf.get_i32_le();
15887 __struct.alt = buf.get_i32_le();
15888 __struct.vx = buf.get_i16_le();
15889 __struct.vy = buf.get_i16_le();
15890 __struct.vz = buf.get_i16_le();
15891 __struct.xacc = buf.get_i16_le();
15892 __struct.yacc = buf.get_i16_le();
15893 __struct.zacc = buf.get_i16_le();
15894 Ok(__struct)
15895 }
15896 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15897 let mut __tmp = BytesMut::new(bytes);
15898 #[allow(clippy::absurd_extreme_comparisons)]
15899 #[allow(unused_comparisons)]
15900 if __tmp.remaining() < Self::ENCODED_LEN {
15901 panic!(
15902 "buffer is too small (need {} bytes, but got {})",
15903 Self::ENCODED_LEN,
15904 __tmp.remaining(),
15905 )
15906 }
15907 __tmp.put_u64_le(self.time_usec);
15908 __tmp.put_f32_le(self.roll);
15909 __tmp.put_f32_le(self.pitch);
15910 __tmp.put_f32_le(self.yaw);
15911 __tmp.put_f32_le(self.rollspeed);
15912 __tmp.put_f32_le(self.pitchspeed);
15913 __tmp.put_f32_le(self.yawspeed);
15914 __tmp.put_i32_le(self.lat);
15915 __tmp.put_i32_le(self.lon);
15916 __tmp.put_i32_le(self.alt);
15917 __tmp.put_i16_le(self.vx);
15918 __tmp.put_i16_le(self.vy);
15919 __tmp.put_i16_le(self.vz);
15920 __tmp.put_i16_le(self.xacc);
15921 __tmp.put_i16_le(self.yacc);
15922 __tmp.put_i16_le(self.zacc);
15923 if matches!(version, MavlinkVersion::V2) {
15924 let len = __tmp.len();
15925 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15926 } else {
15927 __tmp.len()
15928 }
15929 }
15930}
15931#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
15932#[doc = ""]
15933#[doc = "ID: 115"]
15934#[derive(Debug, Clone, PartialEq)]
15935#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15936#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15937pub struct HIL_STATE_QUATERNION_DATA {
15938 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15939 pub time_usec: u64,
15940 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
15941 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15942 pub attitude_quaternion: [f32; 4],
15943 #[doc = "Body frame roll / phi angular speed"]
15944 pub rollspeed: f32,
15945 #[doc = "Body frame pitch / theta angular speed"]
15946 pub pitchspeed: f32,
15947 #[doc = "Body frame yaw / psi angular speed"]
15948 pub yawspeed: f32,
15949 #[doc = "Latitude"]
15950 pub lat: i32,
15951 #[doc = "Longitude"]
15952 pub lon: i32,
15953 #[doc = "Altitude"]
15954 pub alt: i32,
15955 #[doc = "Ground X Speed (Latitude)"]
15956 pub vx: i16,
15957 #[doc = "Ground Y Speed (Longitude)"]
15958 pub vy: i16,
15959 #[doc = "Ground Z Speed (Altitude)"]
15960 pub vz: i16,
15961 #[doc = "Indicated airspeed"]
15962 pub ind_airspeed: u16,
15963 #[doc = "True airspeed"]
15964 pub true_airspeed: u16,
15965 #[doc = "X acceleration"]
15966 pub xacc: i16,
15967 #[doc = "Y acceleration"]
15968 pub yacc: i16,
15969 #[doc = "Z acceleration"]
15970 pub zacc: i16,
15971}
15972impl HIL_STATE_QUATERNION_DATA {
15973 pub const ENCODED_LEN: usize = 64usize;
15974 pub const DEFAULT: Self = Self {
15975 time_usec: 0_u64,
15976 attitude_quaternion: [0.0_f32; 4usize],
15977 rollspeed: 0.0_f32,
15978 pitchspeed: 0.0_f32,
15979 yawspeed: 0.0_f32,
15980 lat: 0_i32,
15981 lon: 0_i32,
15982 alt: 0_i32,
15983 vx: 0_i16,
15984 vy: 0_i16,
15985 vz: 0_i16,
15986 ind_airspeed: 0_u16,
15987 true_airspeed: 0_u16,
15988 xacc: 0_i16,
15989 yacc: 0_i16,
15990 zacc: 0_i16,
15991 };
15992 #[cfg(feature = "arbitrary")]
15993 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15994 use arbitrary::{Arbitrary, Unstructured};
15995 let mut buf = [0u8; 1024];
15996 rng.fill_bytes(&mut buf);
15997 let mut unstructured = Unstructured::new(&buf);
15998 Self::arbitrary(&mut unstructured).unwrap_or_default()
15999 }
16000}
16001impl Default for HIL_STATE_QUATERNION_DATA {
16002 fn default() -> Self {
16003 Self::DEFAULT.clone()
16004 }
16005}
16006impl MessageData for HIL_STATE_QUATERNION_DATA {
16007 type Message = MavMessage;
16008 const ID: u32 = 115u32;
16009 const NAME: &'static str = "HIL_STATE_QUATERNION";
16010 const EXTRA_CRC: u8 = 4u8;
16011 const ENCODED_LEN: usize = 64usize;
16012 fn deser(
16013 _version: MavlinkVersion,
16014 __input: &[u8],
16015 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16016 let avail_len = __input.len();
16017 let mut payload_buf = [0; Self::ENCODED_LEN];
16018 let mut buf = if avail_len < Self::ENCODED_LEN {
16019 payload_buf[0..avail_len].copy_from_slice(__input);
16020 Bytes::new(&payload_buf)
16021 } else {
16022 Bytes::new(__input)
16023 };
16024 let mut __struct = Self::default();
16025 __struct.time_usec = buf.get_u64_le();
16026 for v in &mut __struct.attitude_quaternion {
16027 let val = buf.get_f32_le();
16028 *v = val;
16029 }
16030 __struct.rollspeed = buf.get_f32_le();
16031 __struct.pitchspeed = buf.get_f32_le();
16032 __struct.yawspeed = buf.get_f32_le();
16033 __struct.lat = buf.get_i32_le();
16034 __struct.lon = buf.get_i32_le();
16035 __struct.alt = buf.get_i32_le();
16036 __struct.vx = buf.get_i16_le();
16037 __struct.vy = buf.get_i16_le();
16038 __struct.vz = buf.get_i16_le();
16039 __struct.ind_airspeed = buf.get_u16_le();
16040 __struct.true_airspeed = buf.get_u16_le();
16041 __struct.xacc = buf.get_i16_le();
16042 __struct.yacc = buf.get_i16_le();
16043 __struct.zacc = buf.get_i16_le();
16044 Ok(__struct)
16045 }
16046 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16047 let mut __tmp = BytesMut::new(bytes);
16048 #[allow(clippy::absurd_extreme_comparisons)]
16049 #[allow(unused_comparisons)]
16050 if __tmp.remaining() < Self::ENCODED_LEN {
16051 panic!(
16052 "buffer is too small (need {} bytes, but got {})",
16053 Self::ENCODED_LEN,
16054 __tmp.remaining(),
16055 )
16056 }
16057 __tmp.put_u64_le(self.time_usec);
16058 for val in &self.attitude_quaternion {
16059 __tmp.put_f32_le(*val);
16060 }
16061 __tmp.put_f32_le(self.rollspeed);
16062 __tmp.put_f32_le(self.pitchspeed);
16063 __tmp.put_f32_le(self.yawspeed);
16064 __tmp.put_i32_le(self.lat);
16065 __tmp.put_i32_le(self.lon);
16066 __tmp.put_i32_le(self.alt);
16067 __tmp.put_i16_le(self.vx);
16068 __tmp.put_i16_le(self.vy);
16069 __tmp.put_i16_le(self.vz);
16070 __tmp.put_u16_le(self.ind_airspeed);
16071 __tmp.put_u16_le(self.true_airspeed);
16072 __tmp.put_i16_le(self.xacc);
16073 __tmp.put_i16_le(self.yacc);
16074 __tmp.put_i16_le(self.zacc);
16075 if matches!(version, MavlinkVersion::V2) {
16076 let len = __tmp.len();
16077 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16078 } else {
16079 __tmp.len()
16080 }
16081 }
16082}
16083#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
16084#[doc = ""]
16085#[doc = "ID: 242"]
16086#[derive(Debug, Clone, PartialEq)]
16087#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16089pub struct HOME_POSITION_DATA {
16090 #[doc = "Latitude (WGS84)"]
16091 pub latitude: i32,
16092 #[doc = "Longitude (WGS84)"]
16093 pub longitude: i32,
16094 #[doc = "Altitude (MSL). Positive for up."]
16095 pub altitude: i32,
16096 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
16097 pub x: f32,
16098 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16099 pub y: f32,
16100 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16101 pub z: f32,
16102 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16103 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16104 pub q: [f32; 4],
16105 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16106 pub approach_x: f32,
16107 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16108 pub approach_y: f32,
16109 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16110 pub approach_z: f32,
16111 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16112 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16113 pub time_usec: u64,
16114}
16115impl HOME_POSITION_DATA {
16116 pub const ENCODED_LEN: usize = 60usize;
16117 pub const DEFAULT: Self = Self {
16118 latitude: 0_i32,
16119 longitude: 0_i32,
16120 altitude: 0_i32,
16121 x: 0.0_f32,
16122 y: 0.0_f32,
16123 z: 0.0_f32,
16124 q: [0.0_f32; 4usize],
16125 approach_x: 0.0_f32,
16126 approach_y: 0.0_f32,
16127 approach_z: 0.0_f32,
16128 time_usec: 0_u64,
16129 };
16130 #[cfg(feature = "arbitrary")]
16131 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16132 use arbitrary::{Arbitrary, Unstructured};
16133 let mut buf = [0u8; 1024];
16134 rng.fill_bytes(&mut buf);
16135 let mut unstructured = Unstructured::new(&buf);
16136 Self::arbitrary(&mut unstructured).unwrap_or_default()
16137 }
16138}
16139impl Default for HOME_POSITION_DATA {
16140 fn default() -> Self {
16141 Self::DEFAULT.clone()
16142 }
16143}
16144impl MessageData for HOME_POSITION_DATA {
16145 type Message = MavMessage;
16146 const ID: u32 = 242u32;
16147 const NAME: &'static str = "HOME_POSITION";
16148 const EXTRA_CRC: u8 = 104u8;
16149 const ENCODED_LEN: usize = 60usize;
16150 fn deser(
16151 _version: MavlinkVersion,
16152 __input: &[u8],
16153 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16154 let avail_len = __input.len();
16155 let mut payload_buf = [0; Self::ENCODED_LEN];
16156 let mut buf = if avail_len < Self::ENCODED_LEN {
16157 payload_buf[0..avail_len].copy_from_slice(__input);
16158 Bytes::new(&payload_buf)
16159 } else {
16160 Bytes::new(__input)
16161 };
16162 let mut __struct = Self::default();
16163 __struct.latitude = buf.get_i32_le();
16164 __struct.longitude = buf.get_i32_le();
16165 __struct.altitude = buf.get_i32_le();
16166 __struct.x = buf.get_f32_le();
16167 __struct.y = buf.get_f32_le();
16168 __struct.z = buf.get_f32_le();
16169 for v in &mut __struct.q {
16170 let val = buf.get_f32_le();
16171 *v = val;
16172 }
16173 __struct.approach_x = buf.get_f32_le();
16174 __struct.approach_y = buf.get_f32_le();
16175 __struct.approach_z = buf.get_f32_le();
16176 __struct.time_usec = buf.get_u64_le();
16177 Ok(__struct)
16178 }
16179 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16180 let mut __tmp = BytesMut::new(bytes);
16181 #[allow(clippy::absurd_extreme_comparisons)]
16182 #[allow(unused_comparisons)]
16183 if __tmp.remaining() < Self::ENCODED_LEN {
16184 panic!(
16185 "buffer is too small (need {} bytes, but got {})",
16186 Self::ENCODED_LEN,
16187 __tmp.remaining(),
16188 )
16189 }
16190 __tmp.put_i32_le(self.latitude);
16191 __tmp.put_i32_le(self.longitude);
16192 __tmp.put_i32_le(self.altitude);
16193 __tmp.put_f32_le(self.x);
16194 __tmp.put_f32_le(self.y);
16195 __tmp.put_f32_le(self.z);
16196 for val in &self.q {
16197 __tmp.put_f32_le(*val);
16198 }
16199 __tmp.put_f32_le(self.approach_x);
16200 __tmp.put_f32_le(self.approach_y);
16201 __tmp.put_f32_le(self.approach_z);
16202 if matches!(version, MavlinkVersion::V2) {
16203 __tmp.put_u64_le(self.time_usec);
16204 let len = __tmp.len();
16205 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16206 } else {
16207 __tmp.len()
16208 }
16209 }
16210}
16211#[doc = "Temperature and humidity from hygrometer."]
16212#[doc = ""]
16213#[doc = "ID: 12920"]
16214#[derive(Debug, Clone, PartialEq)]
16215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16216#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16217pub struct HYGROMETER_SENSOR_DATA {
16218 #[doc = "Temperature"]
16219 pub temperature: i16,
16220 #[doc = "Humidity"]
16221 pub humidity: u16,
16222 #[doc = "Hygrometer ID"]
16223 pub id: u8,
16224}
16225impl HYGROMETER_SENSOR_DATA {
16226 pub const ENCODED_LEN: usize = 5usize;
16227 pub const DEFAULT: Self = Self {
16228 temperature: 0_i16,
16229 humidity: 0_u16,
16230 id: 0_u8,
16231 };
16232 #[cfg(feature = "arbitrary")]
16233 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16234 use arbitrary::{Arbitrary, Unstructured};
16235 let mut buf = [0u8; 1024];
16236 rng.fill_bytes(&mut buf);
16237 let mut unstructured = Unstructured::new(&buf);
16238 Self::arbitrary(&mut unstructured).unwrap_or_default()
16239 }
16240}
16241impl Default for HYGROMETER_SENSOR_DATA {
16242 fn default() -> Self {
16243 Self::DEFAULT.clone()
16244 }
16245}
16246impl MessageData for HYGROMETER_SENSOR_DATA {
16247 type Message = MavMessage;
16248 const ID: u32 = 12920u32;
16249 const NAME: &'static str = "HYGROMETER_SENSOR";
16250 const EXTRA_CRC: u8 = 20u8;
16251 const ENCODED_LEN: usize = 5usize;
16252 fn deser(
16253 _version: MavlinkVersion,
16254 __input: &[u8],
16255 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16256 let avail_len = __input.len();
16257 let mut payload_buf = [0; Self::ENCODED_LEN];
16258 let mut buf = if avail_len < Self::ENCODED_LEN {
16259 payload_buf[0..avail_len].copy_from_slice(__input);
16260 Bytes::new(&payload_buf)
16261 } else {
16262 Bytes::new(__input)
16263 };
16264 let mut __struct = Self::default();
16265 __struct.temperature = buf.get_i16_le();
16266 __struct.humidity = buf.get_u16_le();
16267 __struct.id = buf.get_u8();
16268 Ok(__struct)
16269 }
16270 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16271 let mut __tmp = BytesMut::new(bytes);
16272 #[allow(clippy::absurd_extreme_comparisons)]
16273 #[allow(unused_comparisons)]
16274 if __tmp.remaining() < Self::ENCODED_LEN {
16275 panic!(
16276 "buffer is too small (need {} bytes, but got {})",
16277 Self::ENCODED_LEN,
16278 __tmp.remaining(),
16279 )
16280 }
16281 __tmp.put_i16_le(self.temperature);
16282 __tmp.put_u16_le(self.humidity);
16283 __tmp.put_u8(self.id);
16284 if matches!(version, MavlinkVersion::V2) {
16285 let len = __tmp.len();
16286 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16287 } else {
16288 __tmp.len()
16289 }
16290 }
16291}
16292#[doc = "Illuminator status."]
16293#[doc = ""]
16294#[doc = "ID: 440"]
16295#[derive(Debug, Clone, PartialEq)]
16296#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16297#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16298pub struct ILLUMINATOR_STATUS_DATA {
16299 #[doc = "Time since the start-up of the illuminator in ms"]
16300 pub uptime_ms: u32,
16301 #[doc = "Errors"]
16302 pub error_status: IlluminatorErrorFlags,
16303 #[doc = "Illuminator brightness"]
16304 pub brightness: f32,
16305 #[doc = "Illuminator strobing period in seconds"]
16306 pub strobe_period: f32,
16307 #[doc = "Illuminator strobing duty cycle"]
16308 pub strobe_duty_cycle: f32,
16309 #[doc = "Temperature in Celsius"]
16310 pub temp_c: f32,
16311 #[doc = "Minimum strobing period in seconds"]
16312 pub min_strobe_period: f32,
16313 #[doc = "Maximum strobing period in seconds"]
16314 pub max_strobe_period: f32,
16315 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
16316 pub enable: u8,
16317 #[doc = "Supported illuminator modes"]
16318 pub mode_bitmask: IlluminatorMode,
16319 #[doc = "Illuminator mode"]
16320 pub mode: IlluminatorMode,
16321}
16322impl ILLUMINATOR_STATUS_DATA {
16323 pub const ENCODED_LEN: usize = 35usize;
16324 pub const DEFAULT: Self = Self {
16325 uptime_ms: 0_u32,
16326 error_status: IlluminatorErrorFlags::DEFAULT,
16327 brightness: 0.0_f32,
16328 strobe_period: 0.0_f32,
16329 strobe_duty_cycle: 0.0_f32,
16330 temp_c: 0.0_f32,
16331 min_strobe_period: 0.0_f32,
16332 max_strobe_period: 0.0_f32,
16333 enable: 0_u8,
16334 mode_bitmask: IlluminatorMode::DEFAULT,
16335 mode: IlluminatorMode::DEFAULT,
16336 };
16337 #[cfg(feature = "arbitrary")]
16338 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16339 use arbitrary::{Arbitrary, Unstructured};
16340 let mut buf = [0u8; 1024];
16341 rng.fill_bytes(&mut buf);
16342 let mut unstructured = Unstructured::new(&buf);
16343 Self::arbitrary(&mut unstructured).unwrap_or_default()
16344 }
16345}
16346impl Default for ILLUMINATOR_STATUS_DATA {
16347 fn default() -> Self {
16348 Self::DEFAULT.clone()
16349 }
16350}
16351impl MessageData for ILLUMINATOR_STATUS_DATA {
16352 type Message = MavMessage;
16353 const ID: u32 = 440u32;
16354 const NAME: &'static str = "ILLUMINATOR_STATUS";
16355 const EXTRA_CRC: u8 = 66u8;
16356 const ENCODED_LEN: usize = 35usize;
16357 fn deser(
16358 _version: MavlinkVersion,
16359 __input: &[u8],
16360 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16361 let avail_len = __input.len();
16362 let mut payload_buf = [0; Self::ENCODED_LEN];
16363 let mut buf = if avail_len < Self::ENCODED_LEN {
16364 payload_buf[0..avail_len].copy_from_slice(__input);
16365 Bytes::new(&payload_buf)
16366 } else {
16367 Bytes::new(__input)
16368 };
16369 let mut __struct = Self::default();
16370 __struct.uptime_ms = buf.get_u32_le();
16371 let tmp = buf.get_u32_le();
16372 __struct.error_status = IlluminatorErrorFlags::from_bits(
16373 tmp & IlluminatorErrorFlags::all().bits(),
16374 )
16375 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16376 flag_type: "IlluminatorErrorFlags",
16377 value: tmp as u32,
16378 })?;
16379 __struct.brightness = buf.get_f32_le();
16380 __struct.strobe_period = buf.get_f32_le();
16381 __struct.strobe_duty_cycle = buf.get_f32_le();
16382 __struct.temp_c = buf.get_f32_le();
16383 __struct.min_strobe_period = buf.get_f32_le();
16384 __struct.max_strobe_period = buf.get_f32_le();
16385 __struct.enable = buf.get_u8();
16386 let tmp = buf.get_u8();
16387 __struct.mode_bitmask =
16388 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16389 enum_type: "IlluminatorMode",
16390 value: tmp as u32,
16391 })?;
16392 let tmp = buf.get_u8();
16393 __struct.mode =
16394 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16395 enum_type: "IlluminatorMode",
16396 value: tmp as u32,
16397 })?;
16398 Ok(__struct)
16399 }
16400 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16401 let mut __tmp = BytesMut::new(bytes);
16402 #[allow(clippy::absurd_extreme_comparisons)]
16403 #[allow(unused_comparisons)]
16404 if __tmp.remaining() < Self::ENCODED_LEN {
16405 panic!(
16406 "buffer is too small (need {} bytes, but got {})",
16407 Self::ENCODED_LEN,
16408 __tmp.remaining(),
16409 )
16410 }
16411 __tmp.put_u32_le(self.uptime_ms);
16412 __tmp.put_u32_le(self.error_status.bits());
16413 __tmp.put_f32_le(self.brightness);
16414 __tmp.put_f32_le(self.strobe_period);
16415 __tmp.put_f32_le(self.strobe_duty_cycle);
16416 __tmp.put_f32_le(self.temp_c);
16417 __tmp.put_f32_le(self.min_strobe_period);
16418 __tmp.put_f32_le(self.max_strobe_period);
16419 __tmp.put_u8(self.enable);
16420 __tmp.put_u8(self.mode_bitmask as u8);
16421 __tmp.put_u8(self.mode as u8);
16422 if matches!(version, MavlinkVersion::V2) {
16423 let len = __tmp.len();
16424 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16425 } else {
16426 __tmp.len()
16427 }
16428 }
16429}
16430#[doc = "Status of the Iridium SBD link."]
16431#[doc = ""]
16432#[doc = "ID: 335"]
16433#[derive(Debug, Clone, PartialEq)]
16434#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16436pub struct ISBD_LINK_STATUS_DATA {
16437 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16438 pub timestamp: u64,
16439 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16440 pub last_heartbeat: u64,
16441 #[doc = "Number of failed SBD sessions."]
16442 pub failed_sessions: u16,
16443 #[doc = "Number of successful SBD sessions."]
16444 pub successful_sessions: u16,
16445 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
16446 pub signal_quality: u8,
16447 #[doc = "1: Ring call pending, 0: No call pending."]
16448 pub ring_pending: u8,
16449 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
16450 pub tx_session_pending: u8,
16451 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
16452 pub rx_session_pending: u8,
16453}
16454impl ISBD_LINK_STATUS_DATA {
16455 pub const ENCODED_LEN: usize = 24usize;
16456 pub const DEFAULT: Self = Self {
16457 timestamp: 0_u64,
16458 last_heartbeat: 0_u64,
16459 failed_sessions: 0_u16,
16460 successful_sessions: 0_u16,
16461 signal_quality: 0_u8,
16462 ring_pending: 0_u8,
16463 tx_session_pending: 0_u8,
16464 rx_session_pending: 0_u8,
16465 };
16466 #[cfg(feature = "arbitrary")]
16467 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16468 use arbitrary::{Arbitrary, Unstructured};
16469 let mut buf = [0u8; 1024];
16470 rng.fill_bytes(&mut buf);
16471 let mut unstructured = Unstructured::new(&buf);
16472 Self::arbitrary(&mut unstructured).unwrap_or_default()
16473 }
16474}
16475impl Default for ISBD_LINK_STATUS_DATA {
16476 fn default() -> Self {
16477 Self::DEFAULT.clone()
16478 }
16479}
16480impl MessageData for ISBD_LINK_STATUS_DATA {
16481 type Message = MavMessage;
16482 const ID: u32 = 335u32;
16483 const NAME: &'static str = "ISBD_LINK_STATUS";
16484 const EXTRA_CRC: u8 = 225u8;
16485 const ENCODED_LEN: usize = 24usize;
16486 fn deser(
16487 _version: MavlinkVersion,
16488 __input: &[u8],
16489 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16490 let avail_len = __input.len();
16491 let mut payload_buf = [0; Self::ENCODED_LEN];
16492 let mut buf = if avail_len < Self::ENCODED_LEN {
16493 payload_buf[0..avail_len].copy_from_slice(__input);
16494 Bytes::new(&payload_buf)
16495 } else {
16496 Bytes::new(__input)
16497 };
16498 let mut __struct = Self::default();
16499 __struct.timestamp = buf.get_u64_le();
16500 __struct.last_heartbeat = buf.get_u64_le();
16501 __struct.failed_sessions = buf.get_u16_le();
16502 __struct.successful_sessions = buf.get_u16_le();
16503 __struct.signal_quality = buf.get_u8();
16504 __struct.ring_pending = buf.get_u8();
16505 __struct.tx_session_pending = buf.get_u8();
16506 __struct.rx_session_pending = buf.get_u8();
16507 Ok(__struct)
16508 }
16509 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16510 let mut __tmp = BytesMut::new(bytes);
16511 #[allow(clippy::absurd_extreme_comparisons)]
16512 #[allow(unused_comparisons)]
16513 if __tmp.remaining() < Self::ENCODED_LEN {
16514 panic!(
16515 "buffer is too small (need {} bytes, but got {})",
16516 Self::ENCODED_LEN,
16517 __tmp.remaining(),
16518 )
16519 }
16520 __tmp.put_u64_le(self.timestamp);
16521 __tmp.put_u64_le(self.last_heartbeat);
16522 __tmp.put_u16_le(self.failed_sessions);
16523 __tmp.put_u16_le(self.successful_sessions);
16524 __tmp.put_u8(self.signal_quality);
16525 __tmp.put_u8(self.ring_pending);
16526 __tmp.put_u8(self.tx_session_pending);
16527 __tmp.put_u8(self.rx_session_pending);
16528 if matches!(version, MavlinkVersion::V2) {
16529 let len = __tmp.len();
16530 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16531 } else {
16532 __tmp.len()
16533 }
16534 }
16535}
16536#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
16537#[doc = ""]
16538#[doc = "ID: 149"]
16539#[derive(Debug, Clone, PartialEq)]
16540#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16541#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16542pub struct LANDING_TARGET_DATA {
16543 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16544 pub time_usec: u64,
16545 #[doc = "X-axis angular offset of the target from the center of the image"]
16546 pub angle_x: f32,
16547 #[doc = "Y-axis angular offset of the target from the center of the image"]
16548 pub angle_y: f32,
16549 #[doc = "Distance to the target from the vehicle"]
16550 pub distance: f32,
16551 #[doc = "Size of target along x-axis"]
16552 pub size_x: f32,
16553 #[doc = "Size of target along y-axis"]
16554 pub size_y: f32,
16555 #[doc = "The ID of the target if multiple targets are present"]
16556 pub target_num: u8,
16557 #[doc = "Coordinate frame used for following fields."]
16558 pub frame: MavFrame,
16559 #[doc = "X Position of the landing target in MAV_FRAME"]
16560 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16561 pub x: f32,
16562 #[doc = "Y Position of the landing target in MAV_FRAME"]
16563 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16564 pub y: f32,
16565 #[doc = "Z Position of the landing target in MAV_FRAME"]
16566 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16567 pub z: f32,
16568 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
16569 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16570 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16571 pub q: [f32; 4],
16572 #[doc = "Type of landing target"]
16573 #[cfg_attr(feature = "serde", serde(default))]
16574 pub mavtype: LandingTargetType,
16575 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
16576 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16577 pub position_valid: u8,
16578}
16579impl LANDING_TARGET_DATA {
16580 pub const ENCODED_LEN: usize = 60usize;
16581 pub const DEFAULT: Self = Self {
16582 time_usec: 0_u64,
16583 angle_x: 0.0_f32,
16584 angle_y: 0.0_f32,
16585 distance: 0.0_f32,
16586 size_x: 0.0_f32,
16587 size_y: 0.0_f32,
16588 target_num: 0_u8,
16589 frame: MavFrame::DEFAULT,
16590 x: 0.0_f32,
16591 y: 0.0_f32,
16592 z: 0.0_f32,
16593 q: [0.0_f32; 4usize],
16594 mavtype: LandingTargetType::DEFAULT,
16595 position_valid: 0_u8,
16596 };
16597 #[cfg(feature = "arbitrary")]
16598 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16599 use arbitrary::{Arbitrary, Unstructured};
16600 let mut buf = [0u8; 1024];
16601 rng.fill_bytes(&mut buf);
16602 let mut unstructured = Unstructured::new(&buf);
16603 Self::arbitrary(&mut unstructured).unwrap_or_default()
16604 }
16605}
16606impl Default for LANDING_TARGET_DATA {
16607 fn default() -> Self {
16608 Self::DEFAULT.clone()
16609 }
16610}
16611impl MessageData for LANDING_TARGET_DATA {
16612 type Message = MavMessage;
16613 const ID: u32 = 149u32;
16614 const NAME: &'static str = "LANDING_TARGET";
16615 const EXTRA_CRC: u8 = 200u8;
16616 const ENCODED_LEN: usize = 60usize;
16617 fn deser(
16618 _version: MavlinkVersion,
16619 __input: &[u8],
16620 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16621 let avail_len = __input.len();
16622 let mut payload_buf = [0; Self::ENCODED_LEN];
16623 let mut buf = if avail_len < Self::ENCODED_LEN {
16624 payload_buf[0..avail_len].copy_from_slice(__input);
16625 Bytes::new(&payload_buf)
16626 } else {
16627 Bytes::new(__input)
16628 };
16629 let mut __struct = Self::default();
16630 __struct.time_usec = buf.get_u64_le();
16631 __struct.angle_x = buf.get_f32_le();
16632 __struct.angle_y = buf.get_f32_le();
16633 __struct.distance = buf.get_f32_le();
16634 __struct.size_x = buf.get_f32_le();
16635 __struct.size_y = buf.get_f32_le();
16636 __struct.target_num = buf.get_u8();
16637 let tmp = buf.get_u8();
16638 __struct.frame =
16639 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16640 enum_type: "MavFrame",
16641 value: tmp as u32,
16642 })?;
16643 __struct.x = buf.get_f32_le();
16644 __struct.y = buf.get_f32_le();
16645 __struct.z = buf.get_f32_le();
16646 for v in &mut __struct.q {
16647 let val = buf.get_f32_le();
16648 *v = val;
16649 }
16650 let tmp = buf.get_u8();
16651 __struct.mavtype =
16652 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16653 enum_type: "LandingTargetType",
16654 value: tmp as u32,
16655 })?;
16656 __struct.position_valid = buf.get_u8();
16657 Ok(__struct)
16658 }
16659 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16660 let mut __tmp = BytesMut::new(bytes);
16661 #[allow(clippy::absurd_extreme_comparisons)]
16662 #[allow(unused_comparisons)]
16663 if __tmp.remaining() < Self::ENCODED_LEN {
16664 panic!(
16665 "buffer is too small (need {} bytes, but got {})",
16666 Self::ENCODED_LEN,
16667 __tmp.remaining(),
16668 )
16669 }
16670 __tmp.put_u64_le(self.time_usec);
16671 __tmp.put_f32_le(self.angle_x);
16672 __tmp.put_f32_le(self.angle_y);
16673 __tmp.put_f32_le(self.distance);
16674 __tmp.put_f32_le(self.size_x);
16675 __tmp.put_f32_le(self.size_y);
16676 __tmp.put_u8(self.target_num);
16677 __tmp.put_u8(self.frame as u8);
16678 if matches!(version, MavlinkVersion::V2) {
16679 __tmp.put_f32_le(self.x);
16680 __tmp.put_f32_le(self.y);
16681 __tmp.put_f32_le(self.z);
16682 for val in &self.q {
16683 __tmp.put_f32_le(*val);
16684 }
16685 __tmp.put_u8(self.mavtype as u8);
16686 __tmp.put_u8(self.position_valid);
16687 let len = __tmp.len();
16688 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16689 } else {
16690 __tmp.len()
16691 }
16692 }
16693}
16694#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
16695#[doc = ""]
16696#[doc = "ID: 8"]
16697#[derive(Debug, Clone, PartialEq)]
16698#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16699#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16700pub struct LINK_NODE_STATUS_DATA {
16701 #[doc = "Timestamp (time since system boot)."]
16702 pub timestamp: u64,
16703 #[doc = "Transmit rate"]
16704 pub tx_rate: u32,
16705 #[doc = "Receive rate"]
16706 pub rx_rate: u32,
16707 #[doc = "Messages sent"]
16708 pub messages_sent: u32,
16709 #[doc = "Messages received (estimated from counting seq)"]
16710 pub messages_received: u32,
16711 #[doc = "Messages lost (estimated from counting seq)"]
16712 pub messages_lost: u32,
16713 #[doc = "Number of bytes that could not be parsed correctly."]
16714 pub rx_parse_err: u16,
16715 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
16716 pub tx_overflows: u16,
16717 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
16718 pub rx_overflows: u16,
16719 #[doc = "Remaining free transmit buffer space"]
16720 pub tx_buf: u8,
16721 #[doc = "Remaining free receive buffer space"]
16722 pub rx_buf: u8,
16723}
16724impl LINK_NODE_STATUS_DATA {
16725 pub const ENCODED_LEN: usize = 36usize;
16726 pub const DEFAULT: Self = Self {
16727 timestamp: 0_u64,
16728 tx_rate: 0_u32,
16729 rx_rate: 0_u32,
16730 messages_sent: 0_u32,
16731 messages_received: 0_u32,
16732 messages_lost: 0_u32,
16733 rx_parse_err: 0_u16,
16734 tx_overflows: 0_u16,
16735 rx_overflows: 0_u16,
16736 tx_buf: 0_u8,
16737 rx_buf: 0_u8,
16738 };
16739 #[cfg(feature = "arbitrary")]
16740 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16741 use arbitrary::{Arbitrary, Unstructured};
16742 let mut buf = [0u8; 1024];
16743 rng.fill_bytes(&mut buf);
16744 let mut unstructured = Unstructured::new(&buf);
16745 Self::arbitrary(&mut unstructured).unwrap_or_default()
16746 }
16747}
16748impl Default for LINK_NODE_STATUS_DATA {
16749 fn default() -> Self {
16750 Self::DEFAULT.clone()
16751 }
16752}
16753impl MessageData for LINK_NODE_STATUS_DATA {
16754 type Message = MavMessage;
16755 const ID: u32 = 8u32;
16756 const NAME: &'static str = "LINK_NODE_STATUS";
16757 const EXTRA_CRC: u8 = 117u8;
16758 const ENCODED_LEN: usize = 36usize;
16759 fn deser(
16760 _version: MavlinkVersion,
16761 __input: &[u8],
16762 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16763 let avail_len = __input.len();
16764 let mut payload_buf = [0; Self::ENCODED_LEN];
16765 let mut buf = if avail_len < Self::ENCODED_LEN {
16766 payload_buf[0..avail_len].copy_from_slice(__input);
16767 Bytes::new(&payload_buf)
16768 } else {
16769 Bytes::new(__input)
16770 };
16771 let mut __struct = Self::default();
16772 __struct.timestamp = buf.get_u64_le();
16773 __struct.tx_rate = buf.get_u32_le();
16774 __struct.rx_rate = buf.get_u32_le();
16775 __struct.messages_sent = buf.get_u32_le();
16776 __struct.messages_received = buf.get_u32_le();
16777 __struct.messages_lost = buf.get_u32_le();
16778 __struct.rx_parse_err = buf.get_u16_le();
16779 __struct.tx_overflows = buf.get_u16_le();
16780 __struct.rx_overflows = buf.get_u16_le();
16781 __struct.tx_buf = buf.get_u8();
16782 __struct.rx_buf = buf.get_u8();
16783 Ok(__struct)
16784 }
16785 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16786 let mut __tmp = BytesMut::new(bytes);
16787 #[allow(clippy::absurd_extreme_comparisons)]
16788 #[allow(unused_comparisons)]
16789 if __tmp.remaining() < Self::ENCODED_LEN {
16790 panic!(
16791 "buffer is too small (need {} bytes, but got {})",
16792 Self::ENCODED_LEN,
16793 __tmp.remaining(),
16794 )
16795 }
16796 __tmp.put_u64_le(self.timestamp);
16797 __tmp.put_u32_le(self.tx_rate);
16798 __tmp.put_u32_le(self.rx_rate);
16799 __tmp.put_u32_le(self.messages_sent);
16800 __tmp.put_u32_le(self.messages_received);
16801 __tmp.put_u32_le(self.messages_lost);
16802 __tmp.put_u16_le(self.rx_parse_err);
16803 __tmp.put_u16_le(self.tx_overflows);
16804 __tmp.put_u16_le(self.rx_overflows);
16805 __tmp.put_u8(self.tx_buf);
16806 __tmp.put_u8(self.rx_buf);
16807 if matches!(version, MavlinkVersion::V2) {
16808 let len = __tmp.len();
16809 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16810 } else {
16811 __tmp.len()
16812 }
16813 }
16814}
16815#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
16816#[doc = ""]
16817#[doc = "ID: 32"]
16818#[derive(Debug, Clone, PartialEq)]
16819#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16821pub struct LOCAL_POSITION_NED_DATA {
16822 #[doc = "Timestamp (time since system boot)."]
16823 pub time_boot_ms: u32,
16824 #[doc = "X Position"]
16825 pub x: f32,
16826 #[doc = "Y Position"]
16827 pub y: f32,
16828 #[doc = "Z Position"]
16829 pub z: f32,
16830 #[doc = "X Speed"]
16831 pub vx: f32,
16832 #[doc = "Y Speed"]
16833 pub vy: f32,
16834 #[doc = "Z Speed"]
16835 pub vz: f32,
16836}
16837impl LOCAL_POSITION_NED_DATA {
16838 pub const ENCODED_LEN: usize = 28usize;
16839 pub const DEFAULT: Self = Self {
16840 time_boot_ms: 0_u32,
16841 x: 0.0_f32,
16842 y: 0.0_f32,
16843 z: 0.0_f32,
16844 vx: 0.0_f32,
16845 vy: 0.0_f32,
16846 vz: 0.0_f32,
16847 };
16848 #[cfg(feature = "arbitrary")]
16849 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16850 use arbitrary::{Arbitrary, Unstructured};
16851 let mut buf = [0u8; 1024];
16852 rng.fill_bytes(&mut buf);
16853 let mut unstructured = Unstructured::new(&buf);
16854 Self::arbitrary(&mut unstructured).unwrap_or_default()
16855 }
16856}
16857impl Default for LOCAL_POSITION_NED_DATA {
16858 fn default() -> Self {
16859 Self::DEFAULT.clone()
16860 }
16861}
16862impl MessageData for LOCAL_POSITION_NED_DATA {
16863 type Message = MavMessage;
16864 const ID: u32 = 32u32;
16865 const NAME: &'static str = "LOCAL_POSITION_NED";
16866 const EXTRA_CRC: u8 = 185u8;
16867 const ENCODED_LEN: usize = 28usize;
16868 fn deser(
16869 _version: MavlinkVersion,
16870 __input: &[u8],
16871 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16872 let avail_len = __input.len();
16873 let mut payload_buf = [0; Self::ENCODED_LEN];
16874 let mut buf = if avail_len < Self::ENCODED_LEN {
16875 payload_buf[0..avail_len].copy_from_slice(__input);
16876 Bytes::new(&payload_buf)
16877 } else {
16878 Bytes::new(__input)
16879 };
16880 let mut __struct = Self::default();
16881 __struct.time_boot_ms = buf.get_u32_le();
16882 __struct.x = buf.get_f32_le();
16883 __struct.y = buf.get_f32_le();
16884 __struct.z = buf.get_f32_le();
16885 __struct.vx = buf.get_f32_le();
16886 __struct.vy = buf.get_f32_le();
16887 __struct.vz = buf.get_f32_le();
16888 Ok(__struct)
16889 }
16890 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16891 let mut __tmp = BytesMut::new(bytes);
16892 #[allow(clippy::absurd_extreme_comparisons)]
16893 #[allow(unused_comparisons)]
16894 if __tmp.remaining() < Self::ENCODED_LEN {
16895 panic!(
16896 "buffer is too small (need {} bytes, but got {})",
16897 Self::ENCODED_LEN,
16898 __tmp.remaining(),
16899 )
16900 }
16901 __tmp.put_u32_le(self.time_boot_ms);
16902 __tmp.put_f32_le(self.x);
16903 __tmp.put_f32_le(self.y);
16904 __tmp.put_f32_le(self.z);
16905 __tmp.put_f32_le(self.vx);
16906 __tmp.put_f32_le(self.vy);
16907 __tmp.put_f32_le(self.vz);
16908 if matches!(version, MavlinkVersion::V2) {
16909 let len = __tmp.len();
16910 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16911 } else {
16912 __tmp.len()
16913 }
16914 }
16915}
16916#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
16917#[doc = ""]
16918#[doc = "ID: 64"]
16919#[derive(Debug, Clone, PartialEq)]
16920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16922pub struct LOCAL_POSITION_NED_COV_DATA {
16923 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16924 pub time_usec: u64,
16925 #[doc = "X Position"]
16926 pub x: f32,
16927 #[doc = "Y Position"]
16928 pub y: f32,
16929 #[doc = "Z Position"]
16930 pub z: f32,
16931 #[doc = "X Speed"]
16932 pub vx: f32,
16933 #[doc = "Y Speed"]
16934 pub vy: f32,
16935 #[doc = "Z Speed"]
16936 pub vz: f32,
16937 #[doc = "X Acceleration"]
16938 pub ax: f32,
16939 #[doc = "Y Acceleration"]
16940 pub ay: f32,
16941 #[doc = "Z Acceleration"]
16942 pub az: f32,
16943 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
16944 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16945 pub covariance: [f32; 45],
16946 #[doc = "Class id of the estimator this estimate originated from."]
16947 pub estimator_type: MavEstimatorType,
16948}
16949impl LOCAL_POSITION_NED_COV_DATA {
16950 pub const ENCODED_LEN: usize = 225usize;
16951 pub const DEFAULT: Self = Self {
16952 time_usec: 0_u64,
16953 x: 0.0_f32,
16954 y: 0.0_f32,
16955 z: 0.0_f32,
16956 vx: 0.0_f32,
16957 vy: 0.0_f32,
16958 vz: 0.0_f32,
16959 ax: 0.0_f32,
16960 ay: 0.0_f32,
16961 az: 0.0_f32,
16962 covariance: [0.0_f32; 45usize],
16963 estimator_type: MavEstimatorType::DEFAULT,
16964 };
16965 #[cfg(feature = "arbitrary")]
16966 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16967 use arbitrary::{Arbitrary, Unstructured};
16968 let mut buf = [0u8; 1024];
16969 rng.fill_bytes(&mut buf);
16970 let mut unstructured = Unstructured::new(&buf);
16971 Self::arbitrary(&mut unstructured).unwrap_or_default()
16972 }
16973}
16974impl Default for LOCAL_POSITION_NED_COV_DATA {
16975 fn default() -> Self {
16976 Self::DEFAULT.clone()
16977 }
16978}
16979impl MessageData for LOCAL_POSITION_NED_COV_DATA {
16980 type Message = MavMessage;
16981 const ID: u32 = 64u32;
16982 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
16983 const EXTRA_CRC: u8 = 191u8;
16984 const ENCODED_LEN: usize = 225usize;
16985 fn deser(
16986 _version: MavlinkVersion,
16987 __input: &[u8],
16988 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16989 let avail_len = __input.len();
16990 let mut payload_buf = [0; Self::ENCODED_LEN];
16991 let mut buf = if avail_len < Self::ENCODED_LEN {
16992 payload_buf[0..avail_len].copy_from_slice(__input);
16993 Bytes::new(&payload_buf)
16994 } else {
16995 Bytes::new(__input)
16996 };
16997 let mut __struct = Self::default();
16998 __struct.time_usec = buf.get_u64_le();
16999 __struct.x = buf.get_f32_le();
17000 __struct.y = buf.get_f32_le();
17001 __struct.z = buf.get_f32_le();
17002 __struct.vx = buf.get_f32_le();
17003 __struct.vy = buf.get_f32_le();
17004 __struct.vz = buf.get_f32_le();
17005 __struct.ax = buf.get_f32_le();
17006 __struct.ay = buf.get_f32_le();
17007 __struct.az = buf.get_f32_le();
17008 for v in &mut __struct.covariance {
17009 let val = buf.get_f32_le();
17010 *v = val;
17011 }
17012 let tmp = buf.get_u8();
17013 __struct.estimator_type =
17014 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17015 enum_type: "MavEstimatorType",
17016 value: tmp as u32,
17017 })?;
17018 Ok(__struct)
17019 }
17020 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17021 let mut __tmp = BytesMut::new(bytes);
17022 #[allow(clippy::absurd_extreme_comparisons)]
17023 #[allow(unused_comparisons)]
17024 if __tmp.remaining() < Self::ENCODED_LEN {
17025 panic!(
17026 "buffer is too small (need {} bytes, but got {})",
17027 Self::ENCODED_LEN,
17028 __tmp.remaining(),
17029 )
17030 }
17031 __tmp.put_u64_le(self.time_usec);
17032 __tmp.put_f32_le(self.x);
17033 __tmp.put_f32_le(self.y);
17034 __tmp.put_f32_le(self.z);
17035 __tmp.put_f32_le(self.vx);
17036 __tmp.put_f32_le(self.vy);
17037 __tmp.put_f32_le(self.vz);
17038 __tmp.put_f32_le(self.ax);
17039 __tmp.put_f32_le(self.ay);
17040 __tmp.put_f32_le(self.az);
17041 for val in &self.covariance {
17042 __tmp.put_f32_le(*val);
17043 }
17044 __tmp.put_u8(self.estimator_type as u8);
17045 if matches!(version, MavlinkVersion::V2) {
17046 let len = __tmp.len();
17047 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17048 } else {
17049 __tmp.len()
17050 }
17051 }
17052}
17053#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17054#[doc = ""]
17055#[doc = "ID: 89"]
17056#[derive(Debug, Clone, PartialEq)]
17057#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17058#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17059pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17060 #[doc = "Timestamp (time since system boot)."]
17061 pub time_boot_ms: u32,
17062 #[doc = "X Position"]
17063 pub x: f32,
17064 #[doc = "Y Position"]
17065 pub y: f32,
17066 #[doc = "Z Position"]
17067 pub z: f32,
17068 #[doc = "Roll"]
17069 pub roll: f32,
17070 #[doc = "Pitch"]
17071 pub pitch: f32,
17072 #[doc = "Yaw"]
17073 pub yaw: f32,
17074}
17075impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17076 pub const ENCODED_LEN: usize = 28usize;
17077 pub const DEFAULT: Self = Self {
17078 time_boot_ms: 0_u32,
17079 x: 0.0_f32,
17080 y: 0.0_f32,
17081 z: 0.0_f32,
17082 roll: 0.0_f32,
17083 pitch: 0.0_f32,
17084 yaw: 0.0_f32,
17085 };
17086 #[cfg(feature = "arbitrary")]
17087 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17088 use arbitrary::{Arbitrary, Unstructured};
17089 let mut buf = [0u8; 1024];
17090 rng.fill_bytes(&mut buf);
17091 let mut unstructured = Unstructured::new(&buf);
17092 Self::arbitrary(&mut unstructured).unwrap_or_default()
17093 }
17094}
17095impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17096 fn default() -> Self {
17097 Self::DEFAULT.clone()
17098 }
17099}
17100impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17101 type Message = MavMessage;
17102 const ID: u32 = 89u32;
17103 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17104 const EXTRA_CRC: u8 = 231u8;
17105 const ENCODED_LEN: usize = 28usize;
17106 fn deser(
17107 _version: MavlinkVersion,
17108 __input: &[u8],
17109 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17110 let avail_len = __input.len();
17111 let mut payload_buf = [0; Self::ENCODED_LEN];
17112 let mut buf = if avail_len < Self::ENCODED_LEN {
17113 payload_buf[0..avail_len].copy_from_slice(__input);
17114 Bytes::new(&payload_buf)
17115 } else {
17116 Bytes::new(__input)
17117 };
17118 let mut __struct = Self::default();
17119 __struct.time_boot_ms = buf.get_u32_le();
17120 __struct.x = buf.get_f32_le();
17121 __struct.y = buf.get_f32_le();
17122 __struct.z = buf.get_f32_le();
17123 __struct.roll = buf.get_f32_le();
17124 __struct.pitch = buf.get_f32_le();
17125 __struct.yaw = buf.get_f32_le();
17126 Ok(__struct)
17127 }
17128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17129 let mut __tmp = BytesMut::new(bytes);
17130 #[allow(clippy::absurd_extreme_comparisons)]
17131 #[allow(unused_comparisons)]
17132 if __tmp.remaining() < Self::ENCODED_LEN {
17133 panic!(
17134 "buffer is too small (need {} bytes, but got {})",
17135 Self::ENCODED_LEN,
17136 __tmp.remaining(),
17137 )
17138 }
17139 __tmp.put_u32_le(self.time_boot_ms);
17140 __tmp.put_f32_le(self.x);
17141 __tmp.put_f32_le(self.y);
17142 __tmp.put_f32_le(self.z);
17143 __tmp.put_f32_le(self.roll);
17144 __tmp.put_f32_le(self.pitch);
17145 __tmp.put_f32_le(self.yaw);
17146 if matches!(version, MavlinkVersion::V2) {
17147 let len = __tmp.len();
17148 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17149 } else {
17150 __tmp.len()
17151 }
17152 }
17153}
17154#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17155#[doc = ""]
17156#[doc = "ID: 268"]
17157#[derive(Debug, Clone, PartialEq)]
17158#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17159#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17160pub struct LOGGING_ACK_DATA {
17161 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17162 pub sequence: u16,
17163 #[doc = "system ID of the target"]
17164 pub target_system: u8,
17165 #[doc = "component ID of the target"]
17166 pub target_component: u8,
17167}
17168impl LOGGING_ACK_DATA {
17169 pub const ENCODED_LEN: usize = 4usize;
17170 pub const DEFAULT: Self = Self {
17171 sequence: 0_u16,
17172 target_system: 0_u8,
17173 target_component: 0_u8,
17174 };
17175 #[cfg(feature = "arbitrary")]
17176 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17177 use arbitrary::{Arbitrary, Unstructured};
17178 let mut buf = [0u8; 1024];
17179 rng.fill_bytes(&mut buf);
17180 let mut unstructured = Unstructured::new(&buf);
17181 Self::arbitrary(&mut unstructured).unwrap_or_default()
17182 }
17183}
17184impl Default for LOGGING_ACK_DATA {
17185 fn default() -> Self {
17186 Self::DEFAULT.clone()
17187 }
17188}
17189impl MessageData for LOGGING_ACK_DATA {
17190 type Message = MavMessage;
17191 const ID: u32 = 268u32;
17192 const NAME: &'static str = "LOGGING_ACK";
17193 const EXTRA_CRC: u8 = 14u8;
17194 const ENCODED_LEN: usize = 4usize;
17195 fn deser(
17196 _version: MavlinkVersion,
17197 __input: &[u8],
17198 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17199 let avail_len = __input.len();
17200 let mut payload_buf = [0; Self::ENCODED_LEN];
17201 let mut buf = if avail_len < Self::ENCODED_LEN {
17202 payload_buf[0..avail_len].copy_from_slice(__input);
17203 Bytes::new(&payload_buf)
17204 } else {
17205 Bytes::new(__input)
17206 };
17207 let mut __struct = Self::default();
17208 __struct.sequence = buf.get_u16_le();
17209 __struct.target_system = buf.get_u8();
17210 __struct.target_component = buf.get_u8();
17211 Ok(__struct)
17212 }
17213 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17214 let mut __tmp = BytesMut::new(bytes);
17215 #[allow(clippy::absurd_extreme_comparisons)]
17216 #[allow(unused_comparisons)]
17217 if __tmp.remaining() < Self::ENCODED_LEN {
17218 panic!(
17219 "buffer is too small (need {} bytes, but got {})",
17220 Self::ENCODED_LEN,
17221 __tmp.remaining(),
17222 )
17223 }
17224 __tmp.put_u16_le(self.sequence);
17225 __tmp.put_u8(self.target_system);
17226 __tmp.put_u8(self.target_component);
17227 if matches!(version, MavlinkVersion::V2) {
17228 let len = __tmp.len();
17229 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17230 } else {
17231 __tmp.len()
17232 }
17233 }
17234}
17235#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
17236#[doc = ""]
17237#[doc = "ID: 266"]
17238#[derive(Debug, Clone, PartialEq)]
17239#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17240#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17241pub struct LOGGING_DATA_DATA {
17242 #[doc = "sequence number (can wrap)"]
17243 pub sequence: u16,
17244 #[doc = "system ID of the target"]
17245 pub target_system: u8,
17246 #[doc = "component ID of the target"]
17247 pub target_component: u8,
17248 #[doc = "data length"]
17249 pub length: u8,
17250 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17251 pub first_message_offset: u8,
17252 #[doc = "logged data"]
17253 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17254 pub data: [u8; 249],
17255}
17256impl LOGGING_DATA_DATA {
17257 pub const ENCODED_LEN: usize = 255usize;
17258 pub const DEFAULT: Self = Self {
17259 sequence: 0_u16,
17260 target_system: 0_u8,
17261 target_component: 0_u8,
17262 length: 0_u8,
17263 first_message_offset: 0_u8,
17264 data: [0_u8; 249usize],
17265 };
17266 #[cfg(feature = "arbitrary")]
17267 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17268 use arbitrary::{Arbitrary, Unstructured};
17269 let mut buf = [0u8; 1024];
17270 rng.fill_bytes(&mut buf);
17271 let mut unstructured = Unstructured::new(&buf);
17272 Self::arbitrary(&mut unstructured).unwrap_or_default()
17273 }
17274}
17275impl Default for LOGGING_DATA_DATA {
17276 fn default() -> Self {
17277 Self::DEFAULT.clone()
17278 }
17279}
17280impl MessageData for LOGGING_DATA_DATA {
17281 type Message = MavMessage;
17282 const ID: u32 = 266u32;
17283 const NAME: &'static str = "LOGGING_DATA";
17284 const EXTRA_CRC: u8 = 193u8;
17285 const ENCODED_LEN: usize = 255usize;
17286 fn deser(
17287 _version: MavlinkVersion,
17288 __input: &[u8],
17289 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17290 let avail_len = __input.len();
17291 let mut payload_buf = [0; Self::ENCODED_LEN];
17292 let mut buf = if avail_len < Self::ENCODED_LEN {
17293 payload_buf[0..avail_len].copy_from_slice(__input);
17294 Bytes::new(&payload_buf)
17295 } else {
17296 Bytes::new(__input)
17297 };
17298 let mut __struct = Self::default();
17299 __struct.sequence = buf.get_u16_le();
17300 __struct.target_system = buf.get_u8();
17301 __struct.target_component = buf.get_u8();
17302 __struct.length = buf.get_u8();
17303 __struct.first_message_offset = buf.get_u8();
17304 for v in &mut __struct.data {
17305 let val = buf.get_u8();
17306 *v = val;
17307 }
17308 Ok(__struct)
17309 }
17310 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17311 let mut __tmp = BytesMut::new(bytes);
17312 #[allow(clippy::absurd_extreme_comparisons)]
17313 #[allow(unused_comparisons)]
17314 if __tmp.remaining() < Self::ENCODED_LEN {
17315 panic!(
17316 "buffer is too small (need {} bytes, but got {})",
17317 Self::ENCODED_LEN,
17318 __tmp.remaining(),
17319 )
17320 }
17321 __tmp.put_u16_le(self.sequence);
17322 __tmp.put_u8(self.target_system);
17323 __tmp.put_u8(self.target_component);
17324 __tmp.put_u8(self.length);
17325 __tmp.put_u8(self.first_message_offset);
17326 for val in &self.data {
17327 __tmp.put_u8(*val);
17328 }
17329 if matches!(version, MavlinkVersion::V2) {
17330 let len = __tmp.len();
17331 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17332 } else {
17333 __tmp.len()
17334 }
17335 }
17336}
17337#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
17338#[doc = ""]
17339#[doc = "ID: 267"]
17340#[derive(Debug, Clone, PartialEq)]
17341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17343pub struct LOGGING_DATA_ACKED_DATA {
17344 #[doc = "sequence number (can wrap)"]
17345 pub sequence: u16,
17346 #[doc = "system ID of the target"]
17347 pub target_system: u8,
17348 #[doc = "component ID of the target"]
17349 pub target_component: u8,
17350 #[doc = "data length"]
17351 pub length: u8,
17352 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17353 pub first_message_offset: u8,
17354 #[doc = "logged data"]
17355 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17356 pub data: [u8; 249],
17357}
17358impl LOGGING_DATA_ACKED_DATA {
17359 pub const ENCODED_LEN: usize = 255usize;
17360 pub const DEFAULT: Self = Self {
17361 sequence: 0_u16,
17362 target_system: 0_u8,
17363 target_component: 0_u8,
17364 length: 0_u8,
17365 first_message_offset: 0_u8,
17366 data: [0_u8; 249usize],
17367 };
17368 #[cfg(feature = "arbitrary")]
17369 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17370 use arbitrary::{Arbitrary, Unstructured};
17371 let mut buf = [0u8; 1024];
17372 rng.fill_bytes(&mut buf);
17373 let mut unstructured = Unstructured::new(&buf);
17374 Self::arbitrary(&mut unstructured).unwrap_or_default()
17375 }
17376}
17377impl Default for LOGGING_DATA_ACKED_DATA {
17378 fn default() -> Self {
17379 Self::DEFAULT.clone()
17380 }
17381}
17382impl MessageData for LOGGING_DATA_ACKED_DATA {
17383 type Message = MavMessage;
17384 const ID: u32 = 267u32;
17385 const NAME: &'static str = "LOGGING_DATA_ACKED";
17386 const EXTRA_CRC: u8 = 35u8;
17387 const ENCODED_LEN: usize = 255usize;
17388 fn deser(
17389 _version: MavlinkVersion,
17390 __input: &[u8],
17391 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17392 let avail_len = __input.len();
17393 let mut payload_buf = [0; Self::ENCODED_LEN];
17394 let mut buf = if avail_len < Self::ENCODED_LEN {
17395 payload_buf[0..avail_len].copy_from_slice(__input);
17396 Bytes::new(&payload_buf)
17397 } else {
17398 Bytes::new(__input)
17399 };
17400 let mut __struct = Self::default();
17401 __struct.sequence = buf.get_u16_le();
17402 __struct.target_system = buf.get_u8();
17403 __struct.target_component = buf.get_u8();
17404 __struct.length = buf.get_u8();
17405 __struct.first_message_offset = buf.get_u8();
17406 for v in &mut __struct.data {
17407 let val = buf.get_u8();
17408 *v = val;
17409 }
17410 Ok(__struct)
17411 }
17412 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17413 let mut __tmp = BytesMut::new(bytes);
17414 #[allow(clippy::absurd_extreme_comparisons)]
17415 #[allow(unused_comparisons)]
17416 if __tmp.remaining() < Self::ENCODED_LEN {
17417 panic!(
17418 "buffer is too small (need {} bytes, but got {})",
17419 Self::ENCODED_LEN,
17420 __tmp.remaining(),
17421 )
17422 }
17423 __tmp.put_u16_le(self.sequence);
17424 __tmp.put_u8(self.target_system);
17425 __tmp.put_u8(self.target_component);
17426 __tmp.put_u8(self.length);
17427 __tmp.put_u8(self.first_message_offset);
17428 for val in &self.data {
17429 __tmp.put_u8(*val);
17430 }
17431 if matches!(version, MavlinkVersion::V2) {
17432 let len = __tmp.len();
17433 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17434 } else {
17435 __tmp.len()
17436 }
17437 }
17438}
17439#[doc = "Reply to LOG_REQUEST_DATA."]
17440#[doc = ""]
17441#[doc = "ID: 120"]
17442#[derive(Debug, Clone, PartialEq)]
17443#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17444#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17445pub struct LOG_DATA_DATA {
17446 #[doc = "Offset into the log"]
17447 pub ofs: u32,
17448 #[doc = "Log id (from LOG_ENTRY reply)"]
17449 pub id: u16,
17450 #[doc = "Number of bytes (zero for end of log)"]
17451 pub count: u8,
17452 #[doc = "log data"]
17453 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17454 pub data: [u8; 90],
17455}
17456impl LOG_DATA_DATA {
17457 pub const ENCODED_LEN: usize = 97usize;
17458 pub const DEFAULT: Self = Self {
17459 ofs: 0_u32,
17460 id: 0_u16,
17461 count: 0_u8,
17462 data: [0_u8; 90usize],
17463 };
17464 #[cfg(feature = "arbitrary")]
17465 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17466 use arbitrary::{Arbitrary, Unstructured};
17467 let mut buf = [0u8; 1024];
17468 rng.fill_bytes(&mut buf);
17469 let mut unstructured = Unstructured::new(&buf);
17470 Self::arbitrary(&mut unstructured).unwrap_or_default()
17471 }
17472}
17473impl Default for LOG_DATA_DATA {
17474 fn default() -> Self {
17475 Self::DEFAULT.clone()
17476 }
17477}
17478impl MessageData for LOG_DATA_DATA {
17479 type Message = MavMessage;
17480 const ID: u32 = 120u32;
17481 const NAME: &'static str = "LOG_DATA";
17482 const EXTRA_CRC: u8 = 134u8;
17483 const ENCODED_LEN: usize = 97usize;
17484 fn deser(
17485 _version: MavlinkVersion,
17486 __input: &[u8],
17487 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17488 let avail_len = __input.len();
17489 let mut payload_buf = [0; Self::ENCODED_LEN];
17490 let mut buf = if avail_len < Self::ENCODED_LEN {
17491 payload_buf[0..avail_len].copy_from_slice(__input);
17492 Bytes::new(&payload_buf)
17493 } else {
17494 Bytes::new(__input)
17495 };
17496 let mut __struct = Self::default();
17497 __struct.ofs = buf.get_u32_le();
17498 __struct.id = buf.get_u16_le();
17499 __struct.count = buf.get_u8();
17500 for v in &mut __struct.data {
17501 let val = buf.get_u8();
17502 *v = val;
17503 }
17504 Ok(__struct)
17505 }
17506 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17507 let mut __tmp = BytesMut::new(bytes);
17508 #[allow(clippy::absurd_extreme_comparisons)]
17509 #[allow(unused_comparisons)]
17510 if __tmp.remaining() < Self::ENCODED_LEN {
17511 panic!(
17512 "buffer is too small (need {} bytes, but got {})",
17513 Self::ENCODED_LEN,
17514 __tmp.remaining(),
17515 )
17516 }
17517 __tmp.put_u32_le(self.ofs);
17518 __tmp.put_u16_le(self.id);
17519 __tmp.put_u8(self.count);
17520 for val in &self.data {
17521 __tmp.put_u8(*val);
17522 }
17523 if matches!(version, MavlinkVersion::V2) {
17524 let len = __tmp.len();
17525 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17526 } else {
17527 __tmp.len()
17528 }
17529 }
17530}
17531#[doc = "Reply to LOG_REQUEST_LIST."]
17532#[doc = ""]
17533#[doc = "ID: 118"]
17534#[derive(Debug, Clone, PartialEq)]
17535#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17536#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17537pub struct LOG_ENTRY_DATA {
17538 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
17539 pub time_utc: u32,
17540 #[doc = "Size of the log (may be approximate)"]
17541 pub size: u32,
17542 #[doc = "Log id"]
17543 pub id: u16,
17544 #[doc = "Total number of logs"]
17545 pub num_logs: u16,
17546 #[doc = "High log number"]
17547 pub last_log_num: u16,
17548}
17549impl LOG_ENTRY_DATA {
17550 pub const ENCODED_LEN: usize = 14usize;
17551 pub const DEFAULT: Self = Self {
17552 time_utc: 0_u32,
17553 size: 0_u32,
17554 id: 0_u16,
17555 num_logs: 0_u16,
17556 last_log_num: 0_u16,
17557 };
17558 #[cfg(feature = "arbitrary")]
17559 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17560 use arbitrary::{Arbitrary, Unstructured};
17561 let mut buf = [0u8; 1024];
17562 rng.fill_bytes(&mut buf);
17563 let mut unstructured = Unstructured::new(&buf);
17564 Self::arbitrary(&mut unstructured).unwrap_or_default()
17565 }
17566}
17567impl Default for LOG_ENTRY_DATA {
17568 fn default() -> Self {
17569 Self::DEFAULT.clone()
17570 }
17571}
17572impl MessageData for LOG_ENTRY_DATA {
17573 type Message = MavMessage;
17574 const ID: u32 = 118u32;
17575 const NAME: &'static str = "LOG_ENTRY";
17576 const EXTRA_CRC: u8 = 56u8;
17577 const ENCODED_LEN: usize = 14usize;
17578 fn deser(
17579 _version: MavlinkVersion,
17580 __input: &[u8],
17581 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17582 let avail_len = __input.len();
17583 let mut payload_buf = [0; Self::ENCODED_LEN];
17584 let mut buf = if avail_len < Self::ENCODED_LEN {
17585 payload_buf[0..avail_len].copy_from_slice(__input);
17586 Bytes::new(&payload_buf)
17587 } else {
17588 Bytes::new(__input)
17589 };
17590 let mut __struct = Self::default();
17591 __struct.time_utc = buf.get_u32_le();
17592 __struct.size = buf.get_u32_le();
17593 __struct.id = buf.get_u16_le();
17594 __struct.num_logs = buf.get_u16_le();
17595 __struct.last_log_num = buf.get_u16_le();
17596 Ok(__struct)
17597 }
17598 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17599 let mut __tmp = BytesMut::new(bytes);
17600 #[allow(clippy::absurd_extreme_comparisons)]
17601 #[allow(unused_comparisons)]
17602 if __tmp.remaining() < Self::ENCODED_LEN {
17603 panic!(
17604 "buffer is too small (need {} bytes, but got {})",
17605 Self::ENCODED_LEN,
17606 __tmp.remaining(),
17607 )
17608 }
17609 __tmp.put_u32_le(self.time_utc);
17610 __tmp.put_u32_le(self.size);
17611 __tmp.put_u16_le(self.id);
17612 __tmp.put_u16_le(self.num_logs);
17613 __tmp.put_u16_le(self.last_log_num);
17614 if matches!(version, MavlinkVersion::V2) {
17615 let len = __tmp.len();
17616 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17617 } else {
17618 __tmp.len()
17619 }
17620 }
17621}
17622#[doc = "Erase all logs."]
17623#[doc = ""]
17624#[doc = "ID: 121"]
17625#[derive(Debug, Clone, PartialEq)]
17626#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17627#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17628pub struct LOG_ERASE_DATA {
17629 #[doc = "System ID"]
17630 pub target_system: u8,
17631 #[doc = "Component ID"]
17632 pub target_component: u8,
17633}
17634impl LOG_ERASE_DATA {
17635 pub const ENCODED_LEN: usize = 2usize;
17636 pub const DEFAULT: Self = Self {
17637 target_system: 0_u8,
17638 target_component: 0_u8,
17639 };
17640 #[cfg(feature = "arbitrary")]
17641 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17642 use arbitrary::{Arbitrary, Unstructured};
17643 let mut buf = [0u8; 1024];
17644 rng.fill_bytes(&mut buf);
17645 let mut unstructured = Unstructured::new(&buf);
17646 Self::arbitrary(&mut unstructured).unwrap_or_default()
17647 }
17648}
17649impl Default for LOG_ERASE_DATA {
17650 fn default() -> Self {
17651 Self::DEFAULT.clone()
17652 }
17653}
17654impl MessageData for LOG_ERASE_DATA {
17655 type Message = MavMessage;
17656 const ID: u32 = 121u32;
17657 const NAME: &'static str = "LOG_ERASE";
17658 const EXTRA_CRC: u8 = 237u8;
17659 const ENCODED_LEN: usize = 2usize;
17660 fn deser(
17661 _version: MavlinkVersion,
17662 __input: &[u8],
17663 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17664 let avail_len = __input.len();
17665 let mut payload_buf = [0; Self::ENCODED_LEN];
17666 let mut buf = if avail_len < Self::ENCODED_LEN {
17667 payload_buf[0..avail_len].copy_from_slice(__input);
17668 Bytes::new(&payload_buf)
17669 } else {
17670 Bytes::new(__input)
17671 };
17672 let mut __struct = Self::default();
17673 __struct.target_system = buf.get_u8();
17674 __struct.target_component = buf.get_u8();
17675 Ok(__struct)
17676 }
17677 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17678 let mut __tmp = BytesMut::new(bytes);
17679 #[allow(clippy::absurd_extreme_comparisons)]
17680 #[allow(unused_comparisons)]
17681 if __tmp.remaining() < Self::ENCODED_LEN {
17682 panic!(
17683 "buffer is too small (need {} bytes, but got {})",
17684 Self::ENCODED_LEN,
17685 __tmp.remaining(),
17686 )
17687 }
17688 __tmp.put_u8(self.target_system);
17689 __tmp.put_u8(self.target_component);
17690 if matches!(version, MavlinkVersion::V2) {
17691 let len = __tmp.len();
17692 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17693 } else {
17694 __tmp.len()
17695 }
17696 }
17697}
17698#[doc = "Request a chunk of a log."]
17699#[doc = ""]
17700#[doc = "ID: 119"]
17701#[derive(Debug, Clone, PartialEq)]
17702#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17703#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17704pub struct LOG_REQUEST_DATA_DATA {
17705 #[doc = "Offset into the log"]
17706 pub ofs: u32,
17707 #[doc = "Number of bytes"]
17708 pub count: u32,
17709 #[doc = "Log id (from LOG_ENTRY reply)"]
17710 pub id: u16,
17711 #[doc = "System ID"]
17712 pub target_system: u8,
17713 #[doc = "Component ID"]
17714 pub target_component: u8,
17715}
17716impl LOG_REQUEST_DATA_DATA {
17717 pub const ENCODED_LEN: usize = 12usize;
17718 pub const DEFAULT: Self = Self {
17719 ofs: 0_u32,
17720 count: 0_u32,
17721 id: 0_u16,
17722 target_system: 0_u8,
17723 target_component: 0_u8,
17724 };
17725 #[cfg(feature = "arbitrary")]
17726 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17727 use arbitrary::{Arbitrary, Unstructured};
17728 let mut buf = [0u8; 1024];
17729 rng.fill_bytes(&mut buf);
17730 let mut unstructured = Unstructured::new(&buf);
17731 Self::arbitrary(&mut unstructured).unwrap_or_default()
17732 }
17733}
17734impl Default for LOG_REQUEST_DATA_DATA {
17735 fn default() -> Self {
17736 Self::DEFAULT.clone()
17737 }
17738}
17739impl MessageData for LOG_REQUEST_DATA_DATA {
17740 type Message = MavMessage;
17741 const ID: u32 = 119u32;
17742 const NAME: &'static str = "LOG_REQUEST_DATA";
17743 const EXTRA_CRC: u8 = 116u8;
17744 const ENCODED_LEN: usize = 12usize;
17745 fn deser(
17746 _version: MavlinkVersion,
17747 __input: &[u8],
17748 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17749 let avail_len = __input.len();
17750 let mut payload_buf = [0; Self::ENCODED_LEN];
17751 let mut buf = if avail_len < Self::ENCODED_LEN {
17752 payload_buf[0..avail_len].copy_from_slice(__input);
17753 Bytes::new(&payload_buf)
17754 } else {
17755 Bytes::new(__input)
17756 };
17757 let mut __struct = Self::default();
17758 __struct.ofs = buf.get_u32_le();
17759 __struct.count = buf.get_u32_le();
17760 __struct.id = buf.get_u16_le();
17761 __struct.target_system = buf.get_u8();
17762 __struct.target_component = buf.get_u8();
17763 Ok(__struct)
17764 }
17765 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17766 let mut __tmp = BytesMut::new(bytes);
17767 #[allow(clippy::absurd_extreme_comparisons)]
17768 #[allow(unused_comparisons)]
17769 if __tmp.remaining() < Self::ENCODED_LEN {
17770 panic!(
17771 "buffer is too small (need {} bytes, but got {})",
17772 Self::ENCODED_LEN,
17773 __tmp.remaining(),
17774 )
17775 }
17776 __tmp.put_u32_le(self.ofs);
17777 __tmp.put_u32_le(self.count);
17778 __tmp.put_u16_le(self.id);
17779 __tmp.put_u8(self.target_system);
17780 __tmp.put_u8(self.target_component);
17781 if matches!(version, MavlinkVersion::V2) {
17782 let len = __tmp.len();
17783 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17784 } else {
17785 __tmp.len()
17786 }
17787 }
17788}
17789#[doc = "Stop log transfer and resume normal logging."]
17790#[doc = ""]
17791#[doc = "ID: 122"]
17792#[derive(Debug, Clone, PartialEq)]
17793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17795pub struct LOG_REQUEST_END_DATA {
17796 #[doc = "System ID"]
17797 pub target_system: u8,
17798 #[doc = "Component ID"]
17799 pub target_component: u8,
17800}
17801impl LOG_REQUEST_END_DATA {
17802 pub const ENCODED_LEN: usize = 2usize;
17803 pub const DEFAULT: Self = Self {
17804 target_system: 0_u8,
17805 target_component: 0_u8,
17806 };
17807 #[cfg(feature = "arbitrary")]
17808 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17809 use arbitrary::{Arbitrary, Unstructured};
17810 let mut buf = [0u8; 1024];
17811 rng.fill_bytes(&mut buf);
17812 let mut unstructured = Unstructured::new(&buf);
17813 Self::arbitrary(&mut unstructured).unwrap_or_default()
17814 }
17815}
17816impl Default for LOG_REQUEST_END_DATA {
17817 fn default() -> Self {
17818 Self::DEFAULT.clone()
17819 }
17820}
17821impl MessageData for LOG_REQUEST_END_DATA {
17822 type Message = MavMessage;
17823 const ID: u32 = 122u32;
17824 const NAME: &'static str = "LOG_REQUEST_END";
17825 const EXTRA_CRC: u8 = 203u8;
17826 const ENCODED_LEN: usize = 2usize;
17827 fn deser(
17828 _version: MavlinkVersion,
17829 __input: &[u8],
17830 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17831 let avail_len = __input.len();
17832 let mut payload_buf = [0; Self::ENCODED_LEN];
17833 let mut buf = if avail_len < Self::ENCODED_LEN {
17834 payload_buf[0..avail_len].copy_from_slice(__input);
17835 Bytes::new(&payload_buf)
17836 } else {
17837 Bytes::new(__input)
17838 };
17839 let mut __struct = Self::default();
17840 __struct.target_system = buf.get_u8();
17841 __struct.target_component = buf.get_u8();
17842 Ok(__struct)
17843 }
17844 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17845 let mut __tmp = BytesMut::new(bytes);
17846 #[allow(clippy::absurd_extreme_comparisons)]
17847 #[allow(unused_comparisons)]
17848 if __tmp.remaining() < Self::ENCODED_LEN {
17849 panic!(
17850 "buffer is too small (need {} bytes, but got {})",
17851 Self::ENCODED_LEN,
17852 __tmp.remaining(),
17853 )
17854 }
17855 __tmp.put_u8(self.target_system);
17856 __tmp.put_u8(self.target_component);
17857 if matches!(version, MavlinkVersion::V2) {
17858 let len = __tmp.len();
17859 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17860 } else {
17861 __tmp.len()
17862 }
17863 }
17864}
17865#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
17866#[doc = ""]
17867#[doc = "ID: 117"]
17868#[derive(Debug, Clone, PartialEq)]
17869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17870#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17871pub struct LOG_REQUEST_LIST_DATA {
17872 #[doc = "First log id (0 for first available)"]
17873 pub start: u16,
17874 #[doc = "Last log id (0xffff for last available)"]
17875 pub end: u16,
17876 #[doc = "System ID"]
17877 pub target_system: u8,
17878 #[doc = "Component ID"]
17879 pub target_component: u8,
17880}
17881impl LOG_REQUEST_LIST_DATA {
17882 pub const ENCODED_LEN: usize = 6usize;
17883 pub const DEFAULT: Self = Self {
17884 start: 0_u16,
17885 end: 0_u16,
17886 target_system: 0_u8,
17887 target_component: 0_u8,
17888 };
17889 #[cfg(feature = "arbitrary")]
17890 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17891 use arbitrary::{Arbitrary, Unstructured};
17892 let mut buf = [0u8; 1024];
17893 rng.fill_bytes(&mut buf);
17894 let mut unstructured = Unstructured::new(&buf);
17895 Self::arbitrary(&mut unstructured).unwrap_or_default()
17896 }
17897}
17898impl Default for LOG_REQUEST_LIST_DATA {
17899 fn default() -> Self {
17900 Self::DEFAULT.clone()
17901 }
17902}
17903impl MessageData for LOG_REQUEST_LIST_DATA {
17904 type Message = MavMessage;
17905 const ID: u32 = 117u32;
17906 const NAME: &'static str = "LOG_REQUEST_LIST";
17907 const EXTRA_CRC: u8 = 128u8;
17908 const ENCODED_LEN: usize = 6usize;
17909 fn deser(
17910 _version: MavlinkVersion,
17911 __input: &[u8],
17912 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17913 let avail_len = __input.len();
17914 let mut payload_buf = [0; Self::ENCODED_LEN];
17915 let mut buf = if avail_len < Self::ENCODED_LEN {
17916 payload_buf[0..avail_len].copy_from_slice(__input);
17917 Bytes::new(&payload_buf)
17918 } else {
17919 Bytes::new(__input)
17920 };
17921 let mut __struct = Self::default();
17922 __struct.start = buf.get_u16_le();
17923 __struct.end = buf.get_u16_le();
17924 __struct.target_system = buf.get_u8();
17925 __struct.target_component = buf.get_u8();
17926 Ok(__struct)
17927 }
17928 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17929 let mut __tmp = BytesMut::new(bytes);
17930 #[allow(clippy::absurd_extreme_comparisons)]
17931 #[allow(unused_comparisons)]
17932 if __tmp.remaining() < Self::ENCODED_LEN {
17933 panic!(
17934 "buffer is too small (need {} bytes, but got {})",
17935 Self::ENCODED_LEN,
17936 __tmp.remaining(),
17937 )
17938 }
17939 __tmp.put_u16_le(self.start);
17940 __tmp.put_u16_le(self.end);
17941 __tmp.put_u8(self.target_system);
17942 __tmp.put_u8(self.target_component);
17943 if matches!(version, MavlinkVersion::V2) {
17944 let len = __tmp.len();
17945 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17946 } else {
17947 __tmp.len()
17948 }
17949 }
17950}
17951#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
17952#[doc = ""]
17953#[doc = "ID: 192"]
17954#[derive(Debug, Clone, PartialEq)]
17955#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17956#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17957pub struct MAG_CAL_REPORT_DATA {
17958 #[doc = "RMS milligauss residuals."]
17959 pub fitness: f32,
17960 #[doc = "X offset."]
17961 pub ofs_x: f32,
17962 #[doc = "Y offset."]
17963 pub ofs_y: f32,
17964 #[doc = "Z offset."]
17965 pub ofs_z: f32,
17966 #[doc = "X diagonal (matrix 11)."]
17967 pub diag_x: f32,
17968 #[doc = "Y diagonal (matrix 22)."]
17969 pub diag_y: f32,
17970 #[doc = "Z diagonal (matrix 33)."]
17971 pub diag_z: f32,
17972 #[doc = "X off-diagonal (matrix 12 and 21)."]
17973 pub offdiag_x: f32,
17974 #[doc = "Y off-diagonal (matrix 13 and 31)."]
17975 pub offdiag_y: f32,
17976 #[doc = "Z off-diagonal (matrix 32 and 23)."]
17977 pub offdiag_z: f32,
17978 #[doc = "Compass being calibrated."]
17979 pub compass_id: u8,
17980 #[doc = "Bitmask of compasses being calibrated."]
17981 pub cal_mask: u8,
17982 #[doc = "Calibration Status."]
17983 pub cal_status: MagCalStatus,
17984 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
17985 pub autosaved: u8,
17986 #[doc = "Confidence in orientation (higher is better)."]
17987 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17988 pub orientation_confidence: f32,
17989 #[doc = "orientation before calibration."]
17990 #[cfg_attr(feature = "serde", serde(default))]
17991 pub old_orientation: MavSensorOrientation,
17992 #[doc = "orientation after calibration."]
17993 #[cfg_attr(feature = "serde", serde(default))]
17994 pub new_orientation: MavSensorOrientation,
17995 #[doc = "field radius correction factor"]
17996 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17997 pub scale_factor: f32,
17998}
17999impl MAG_CAL_REPORT_DATA {
18000 pub const ENCODED_LEN: usize = 54usize;
18001 pub const DEFAULT: Self = Self {
18002 fitness: 0.0_f32,
18003 ofs_x: 0.0_f32,
18004 ofs_y: 0.0_f32,
18005 ofs_z: 0.0_f32,
18006 diag_x: 0.0_f32,
18007 diag_y: 0.0_f32,
18008 diag_z: 0.0_f32,
18009 offdiag_x: 0.0_f32,
18010 offdiag_y: 0.0_f32,
18011 offdiag_z: 0.0_f32,
18012 compass_id: 0_u8,
18013 cal_mask: 0_u8,
18014 cal_status: MagCalStatus::DEFAULT,
18015 autosaved: 0_u8,
18016 orientation_confidence: 0.0_f32,
18017 old_orientation: MavSensorOrientation::DEFAULT,
18018 new_orientation: MavSensorOrientation::DEFAULT,
18019 scale_factor: 0.0_f32,
18020 };
18021 #[cfg(feature = "arbitrary")]
18022 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18023 use arbitrary::{Arbitrary, Unstructured};
18024 let mut buf = [0u8; 1024];
18025 rng.fill_bytes(&mut buf);
18026 let mut unstructured = Unstructured::new(&buf);
18027 Self::arbitrary(&mut unstructured).unwrap_or_default()
18028 }
18029}
18030impl Default for MAG_CAL_REPORT_DATA {
18031 fn default() -> Self {
18032 Self::DEFAULT.clone()
18033 }
18034}
18035impl MessageData for MAG_CAL_REPORT_DATA {
18036 type Message = MavMessage;
18037 const ID: u32 = 192u32;
18038 const NAME: &'static str = "MAG_CAL_REPORT";
18039 const EXTRA_CRC: u8 = 36u8;
18040 const ENCODED_LEN: usize = 54usize;
18041 fn deser(
18042 _version: MavlinkVersion,
18043 __input: &[u8],
18044 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18045 let avail_len = __input.len();
18046 let mut payload_buf = [0; Self::ENCODED_LEN];
18047 let mut buf = if avail_len < Self::ENCODED_LEN {
18048 payload_buf[0..avail_len].copy_from_slice(__input);
18049 Bytes::new(&payload_buf)
18050 } else {
18051 Bytes::new(__input)
18052 };
18053 let mut __struct = Self::default();
18054 __struct.fitness = buf.get_f32_le();
18055 __struct.ofs_x = buf.get_f32_le();
18056 __struct.ofs_y = buf.get_f32_le();
18057 __struct.ofs_z = buf.get_f32_le();
18058 __struct.diag_x = buf.get_f32_le();
18059 __struct.diag_y = buf.get_f32_le();
18060 __struct.diag_z = buf.get_f32_le();
18061 __struct.offdiag_x = buf.get_f32_le();
18062 __struct.offdiag_y = buf.get_f32_le();
18063 __struct.offdiag_z = buf.get_f32_le();
18064 __struct.compass_id = buf.get_u8();
18065 __struct.cal_mask = buf.get_u8();
18066 let tmp = buf.get_u8();
18067 __struct.cal_status =
18068 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18069 enum_type: "MagCalStatus",
18070 value: tmp as u32,
18071 })?;
18072 __struct.autosaved = buf.get_u8();
18073 __struct.orientation_confidence = buf.get_f32_le();
18074 let tmp = buf.get_u8();
18075 __struct.old_orientation =
18076 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18077 enum_type: "MavSensorOrientation",
18078 value: tmp as u32,
18079 })?;
18080 let tmp = buf.get_u8();
18081 __struct.new_orientation =
18082 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18083 enum_type: "MavSensorOrientation",
18084 value: tmp as u32,
18085 })?;
18086 __struct.scale_factor = buf.get_f32_le();
18087 Ok(__struct)
18088 }
18089 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18090 let mut __tmp = BytesMut::new(bytes);
18091 #[allow(clippy::absurd_extreme_comparisons)]
18092 #[allow(unused_comparisons)]
18093 if __tmp.remaining() < Self::ENCODED_LEN {
18094 panic!(
18095 "buffer is too small (need {} bytes, but got {})",
18096 Self::ENCODED_LEN,
18097 __tmp.remaining(),
18098 )
18099 }
18100 __tmp.put_f32_le(self.fitness);
18101 __tmp.put_f32_le(self.ofs_x);
18102 __tmp.put_f32_le(self.ofs_y);
18103 __tmp.put_f32_le(self.ofs_z);
18104 __tmp.put_f32_le(self.diag_x);
18105 __tmp.put_f32_le(self.diag_y);
18106 __tmp.put_f32_le(self.diag_z);
18107 __tmp.put_f32_le(self.offdiag_x);
18108 __tmp.put_f32_le(self.offdiag_y);
18109 __tmp.put_f32_le(self.offdiag_z);
18110 __tmp.put_u8(self.compass_id);
18111 __tmp.put_u8(self.cal_mask);
18112 __tmp.put_u8(self.cal_status as u8);
18113 __tmp.put_u8(self.autosaved);
18114 if matches!(version, MavlinkVersion::V2) {
18115 __tmp.put_f32_le(self.orientation_confidence);
18116 __tmp.put_u8(self.old_orientation as u8);
18117 __tmp.put_u8(self.new_orientation as u8);
18118 __tmp.put_f32_le(self.scale_factor);
18119 let len = __tmp.len();
18120 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18121 } else {
18122 __tmp.len()
18123 }
18124 }
18125}
18126#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18127#[doc = ""]
18128#[doc = "ID: 69"]
18129#[derive(Debug, Clone, PartialEq)]
18130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18131#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18132pub struct MANUAL_CONTROL_DATA {
18133 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18134 pub x: i16,
18135 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18136 pub y: i16,
18137 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18138 pub z: i16,
18139 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18140 pub r: i16,
18141 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18142 pub buttons: u16,
18143 #[doc = "The system to be controlled."]
18144 pub target: u8,
18145 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18146 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18147 pub buttons2: u16,
18148 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18149 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18150 pub enabled_extensions: u8,
18151 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18152 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18153 pub s: i16,
18154 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18155 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18156 pub t: i16,
18157 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18158 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18159 pub aux1: i16,
18160 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18161 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18162 pub aux2: i16,
18163 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18164 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18165 pub aux3: i16,
18166 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18167 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18168 pub aux4: i16,
18169 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18170 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18171 pub aux5: i16,
18172 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18173 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18174 pub aux6: i16,
18175}
18176impl MANUAL_CONTROL_DATA {
18177 pub const ENCODED_LEN: usize = 30usize;
18178 pub const DEFAULT: Self = Self {
18179 x: 0_i16,
18180 y: 0_i16,
18181 z: 0_i16,
18182 r: 0_i16,
18183 buttons: 0_u16,
18184 target: 0_u8,
18185 buttons2: 0_u16,
18186 enabled_extensions: 0_u8,
18187 s: 0_i16,
18188 t: 0_i16,
18189 aux1: 0_i16,
18190 aux2: 0_i16,
18191 aux3: 0_i16,
18192 aux4: 0_i16,
18193 aux5: 0_i16,
18194 aux6: 0_i16,
18195 };
18196 #[cfg(feature = "arbitrary")]
18197 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18198 use arbitrary::{Arbitrary, Unstructured};
18199 let mut buf = [0u8; 1024];
18200 rng.fill_bytes(&mut buf);
18201 let mut unstructured = Unstructured::new(&buf);
18202 Self::arbitrary(&mut unstructured).unwrap_or_default()
18203 }
18204}
18205impl Default for MANUAL_CONTROL_DATA {
18206 fn default() -> Self {
18207 Self::DEFAULT.clone()
18208 }
18209}
18210impl MessageData for MANUAL_CONTROL_DATA {
18211 type Message = MavMessage;
18212 const ID: u32 = 69u32;
18213 const NAME: &'static str = "MANUAL_CONTROL";
18214 const EXTRA_CRC: u8 = 243u8;
18215 const ENCODED_LEN: usize = 30usize;
18216 fn deser(
18217 _version: MavlinkVersion,
18218 __input: &[u8],
18219 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18220 let avail_len = __input.len();
18221 let mut payload_buf = [0; Self::ENCODED_LEN];
18222 let mut buf = if avail_len < Self::ENCODED_LEN {
18223 payload_buf[0..avail_len].copy_from_slice(__input);
18224 Bytes::new(&payload_buf)
18225 } else {
18226 Bytes::new(__input)
18227 };
18228 let mut __struct = Self::default();
18229 __struct.x = buf.get_i16_le();
18230 __struct.y = buf.get_i16_le();
18231 __struct.z = buf.get_i16_le();
18232 __struct.r = buf.get_i16_le();
18233 __struct.buttons = buf.get_u16_le();
18234 __struct.target = buf.get_u8();
18235 __struct.buttons2 = buf.get_u16_le();
18236 __struct.enabled_extensions = buf.get_u8();
18237 __struct.s = buf.get_i16_le();
18238 __struct.t = buf.get_i16_le();
18239 __struct.aux1 = buf.get_i16_le();
18240 __struct.aux2 = buf.get_i16_le();
18241 __struct.aux3 = buf.get_i16_le();
18242 __struct.aux4 = buf.get_i16_le();
18243 __struct.aux5 = buf.get_i16_le();
18244 __struct.aux6 = buf.get_i16_le();
18245 Ok(__struct)
18246 }
18247 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18248 let mut __tmp = BytesMut::new(bytes);
18249 #[allow(clippy::absurd_extreme_comparisons)]
18250 #[allow(unused_comparisons)]
18251 if __tmp.remaining() < Self::ENCODED_LEN {
18252 panic!(
18253 "buffer is too small (need {} bytes, but got {})",
18254 Self::ENCODED_LEN,
18255 __tmp.remaining(),
18256 )
18257 }
18258 __tmp.put_i16_le(self.x);
18259 __tmp.put_i16_le(self.y);
18260 __tmp.put_i16_le(self.z);
18261 __tmp.put_i16_le(self.r);
18262 __tmp.put_u16_le(self.buttons);
18263 __tmp.put_u8(self.target);
18264 if matches!(version, MavlinkVersion::V2) {
18265 __tmp.put_u16_le(self.buttons2);
18266 __tmp.put_u8(self.enabled_extensions);
18267 __tmp.put_i16_le(self.s);
18268 __tmp.put_i16_le(self.t);
18269 __tmp.put_i16_le(self.aux1);
18270 __tmp.put_i16_le(self.aux2);
18271 __tmp.put_i16_le(self.aux3);
18272 __tmp.put_i16_le(self.aux4);
18273 __tmp.put_i16_le(self.aux5);
18274 __tmp.put_i16_le(self.aux6);
18275 let len = __tmp.len();
18276 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18277 } else {
18278 __tmp.len()
18279 }
18280 }
18281}
18282#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
18283#[doc = ""]
18284#[doc = "ID: 81"]
18285#[derive(Debug, Clone, PartialEq)]
18286#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18288pub struct MANUAL_SETPOINT_DATA {
18289 #[doc = "Timestamp (time since system boot)."]
18290 pub time_boot_ms: u32,
18291 #[doc = "Desired roll rate"]
18292 pub roll: f32,
18293 #[doc = "Desired pitch rate"]
18294 pub pitch: f32,
18295 #[doc = "Desired yaw rate"]
18296 pub yaw: f32,
18297 #[doc = "Collective thrust, normalized to 0 .. 1"]
18298 pub thrust: f32,
18299 #[doc = "Flight mode switch position, 0.. 255"]
18300 pub mode_switch: u8,
18301 #[doc = "Override mode switch position, 0.. 255"]
18302 pub manual_override_switch: u8,
18303}
18304impl MANUAL_SETPOINT_DATA {
18305 pub const ENCODED_LEN: usize = 22usize;
18306 pub const DEFAULT: Self = Self {
18307 time_boot_ms: 0_u32,
18308 roll: 0.0_f32,
18309 pitch: 0.0_f32,
18310 yaw: 0.0_f32,
18311 thrust: 0.0_f32,
18312 mode_switch: 0_u8,
18313 manual_override_switch: 0_u8,
18314 };
18315 #[cfg(feature = "arbitrary")]
18316 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18317 use arbitrary::{Arbitrary, Unstructured};
18318 let mut buf = [0u8; 1024];
18319 rng.fill_bytes(&mut buf);
18320 let mut unstructured = Unstructured::new(&buf);
18321 Self::arbitrary(&mut unstructured).unwrap_or_default()
18322 }
18323}
18324impl Default for MANUAL_SETPOINT_DATA {
18325 fn default() -> Self {
18326 Self::DEFAULT.clone()
18327 }
18328}
18329impl MessageData for MANUAL_SETPOINT_DATA {
18330 type Message = MavMessage;
18331 const ID: u32 = 81u32;
18332 const NAME: &'static str = "MANUAL_SETPOINT";
18333 const EXTRA_CRC: u8 = 106u8;
18334 const ENCODED_LEN: usize = 22usize;
18335 fn deser(
18336 _version: MavlinkVersion,
18337 __input: &[u8],
18338 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18339 let avail_len = __input.len();
18340 let mut payload_buf = [0; Self::ENCODED_LEN];
18341 let mut buf = if avail_len < Self::ENCODED_LEN {
18342 payload_buf[0..avail_len].copy_from_slice(__input);
18343 Bytes::new(&payload_buf)
18344 } else {
18345 Bytes::new(__input)
18346 };
18347 let mut __struct = Self::default();
18348 __struct.time_boot_ms = buf.get_u32_le();
18349 __struct.roll = buf.get_f32_le();
18350 __struct.pitch = buf.get_f32_le();
18351 __struct.yaw = buf.get_f32_le();
18352 __struct.thrust = buf.get_f32_le();
18353 __struct.mode_switch = buf.get_u8();
18354 __struct.manual_override_switch = buf.get_u8();
18355 Ok(__struct)
18356 }
18357 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18358 let mut __tmp = BytesMut::new(bytes);
18359 #[allow(clippy::absurd_extreme_comparisons)]
18360 #[allow(unused_comparisons)]
18361 if __tmp.remaining() < Self::ENCODED_LEN {
18362 panic!(
18363 "buffer is too small (need {} bytes, but got {})",
18364 Self::ENCODED_LEN,
18365 __tmp.remaining(),
18366 )
18367 }
18368 __tmp.put_u32_le(self.time_boot_ms);
18369 __tmp.put_f32_le(self.roll);
18370 __tmp.put_f32_le(self.pitch);
18371 __tmp.put_f32_le(self.yaw);
18372 __tmp.put_f32_le(self.thrust);
18373 __tmp.put_u8(self.mode_switch);
18374 __tmp.put_u8(self.manual_override_switch);
18375 if matches!(version, MavlinkVersion::V2) {
18376 let len = __tmp.len();
18377 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18378 } else {
18379 __tmp.len()
18380 }
18381 }
18382}
18383#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
18384#[doc = ""]
18385#[doc = "ID: 249"]
18386#[derive(Debug, Clone, PartialEq)]
18387#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18388#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18389pub struct MEMORY_VECT_DATA {
18390 #[doc = "Starting address of the debug variables"]
18391 pub address: u16,
18392 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
18393 pub ver: u8,
18394 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
18395 pub mavtype: u8,
18396 #[doc = "Memory contents at specified address"]
18397 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18398 pub value: [i8; 32],
18399}
18400impl MEMORY_VECT_DATA {
18401 pub const ENCODED_LEN: usize = 36usize;
18402 pub const DEFAULT: Self = Self {
18403 address: 0_u16,
18404 ver: 0_u8,
18405 mavtype: 0_u8,
18406 value: [0_i8; 32usize],
18407 };
18408 #[cfg(feature = "arbitrary")]
18409 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18410 use arbitrary::{Arbitrary, Unstructured};
18411 let mut buf = [0u8; 1024];
18412 rng.fill_bytes(&mut buf);
18413 let mut unstructured = Unstructured::new(&buf);
18414 Self::arbitrary(&mut unstructured).unwrap_or_default()
18415 }
18416}
18417impl Default for MEMORY_VECT_DATA {
18418 fn default() -> Self {
18419 Self::DEFAULT.clone()
18420 }
18421}
18422impl MessageData for MEMORY_VECT_DATA {
18423 type Message = MavMessage;
18424 const ID: u32 = 249u32;
18425 const NAME: &'static str = "MEMORY_VECT";
18426 const EXTRA_CRC: u8 = 204u8;
18427 const ENCODED_LEN: usize = 36usize;
18428 fn deser(
18429 _version: MavlinkVersion,
18430 __input: &[u8],
18431 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18432 let avail_len = __input.len();
18433 let mut payload_buf = [0; Self::ENCODED_LEN];
18434 let mut buf = if avail_len < Self::ENCODED_LEN {
18435 payload_buf[0..avail_len].copy_from_slice(__input);
18436 Bytes::new(&payload_buf)
18437 } else {
18438 Bytes::new(__input)
18439 };
18440 let mut __struct = Self::default();
18441 __struct.address = buf.get_u16_le();
18442 __struct.ver = buf.get_u8();
18443 __struct.mavtype = buf.get_u8();
18444 for v in &mut __struct.value {
18445 let val = buf.get_i8();
18446 *v = val;
18447 }
18448 Ok(__struct)
18449 }
18450 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18451 let mut __tmp = BytesMut::new(bytes);
18452 #[allow(clippy::absurd_extreme_comparisons)]
18453 #[allow(unused_comparisons)]
18454 if __tmp.remaining() < Self::ENCODED_LEN {
18455 panic!(
18456 "buffer is too small (need {} bytes, but got {})",
18457 Self::ENCODED_LEN,
18458 __tmp.remaining(),
18459 )
18460 }
18461 __tmp.put_u16_le(self.address);
18462 __tmp.put_u8(self.ver);
18463 __tmp.put_u8(self.mavtype);
18464 for val in &self.value {
18465 __tmp.put_i8(*val);
18466 }
18467 if matches!(version, MavlinkVersion::V2) {
18468 let len = __tmp.len();
18469 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18470 } else {
18471 __tmp.len()
18472 }
18473 }
18474}
18475#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
18476#[doc = ""]
18477#[doc = "ID: 244"]
18478#[derive(Debug, Clone, PartialEq)]
18479#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18480#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18481pub struct MESSAGE_INTERVAL_DATA {
18482 #[doc = "0 indicates the interval at which it is sent."]
18483 pub interval_us: i32,
18484 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
18485 pub message_id: u16,
18486}
18487impl MESSAGE_INTERVAL_DATA {
18488 pub const ENCODED_LEN: usize = 6usize;
18489 pub const DEFAULT: Self = Self {
18490 interval_us: 0_i32,
18491 message_id: 0_u16,
18492 };
18493 #[cfg(feature = "arbitrary")]
18494 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18495 use arbitrary::{Arbitrary, Unstructured};
18496 let mut buf = [0u8; 1024];
18497 rng.fill_bytes(&mut buf);
18498 let mut unstructured = Unstructured::new(&buf);
18499 Self::arbitrary(&mut unstructured).unwrap_or_default()
18500 }
18501}
18502impl Default for MESSAGE_INTERVAL_DATA {
18503 fn default() -> Self {
18504 Self::DEFAULT.clone()
18505 }
18506}
18507impl MessageData for MESSAGE_INTERVAL_DATA {
18508 type Message = MavMessage;
18509 const ID: u32 = 244u32;
18510 const NAME: &'static str = "MESSAGE_INTERVAL";
18511 const EXTRA_CRC: u8 = 95u8;
18512 const ENCODED_LEN: usize = 6usize;
18513 fn deser(
18514 _version: MavlinkVersion,
18515 __input: &[u8],
18516 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18517 let avail_len = __input.len();
18518 let mut payload_buf = [0; Self::ENCODED_LEN];
18519 let mut buf = if avail_len < Self::ENCODED_LEN {
18520 payload_buf[0..avail_len].copy_from_slice(__input);
18521 Bytes::new(&payload_buf)
18522 } else {
18523 Bytes::new(__input)
18524 };
18525 let mut __struct = Self::default();
18526 __struct.interval_us = buf.get_i32_le();
18527 __struct.message_id = buf.get_u16_le();
18528 Ok(__struct)
18529 }
18530 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18531 let mut __tmp = BytesMut::new(bytes);
18532 #[allow(clippy::absurd_extreme_comparisons)]
18533 #[allow(unused_comparisons)]
18534 if __tmp.remaining() < Self::ENCODED_LEN {
18535 panic!(
18536 "buffer is too small (need {} bytes, but got {})",
18537 Self::ENCODED_LEN,
18538 __tmp.remaining(),
18539 )
18540 }
18541 __tmp.put_i32_le(self.interval_us);
18542 __tmp.put_u16_le(self.message_id);
18543 if matches!(version, MavlinkVersion::V2) {
18544 let len = __tmp.len();
18545 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18546 } else {
18547 __tmp.len()
18548 }
18549 }
18550}
18551#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
18552#[doc = ""]
18553#[doc = "ID: 47"]
18554#[derive(Debug, Clone, PartialEq)]
18555#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18556#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18557pub struct MISSION_ACK_DATA {
18558 #[doc = "System ID"]
18559 pub target_system: u8,
18560 #[doc = "Component ID"]
18561 pub target_component: u8,
18562 #[doc = "Mission result."]
18563 pub mavtype: MavMissionResult,
18564 #[doc = "Mission type."]
18565 #[cfg_attr(feature = "serde", serde(default))]
18566 pub mission_type: MavMissionType,
18567 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
18568 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18569 pub opaque_id: u32,
18570}
18571impl MISSION_ACK_DATA {
18572 pub const ENCODED_LEN: usize = 8usize;
18573 pub const DEFAULT: Self = Self {
18574 target_system: 0_u8,
18575 target_component: 0_u8,
18576 mavtype: MavMissionResult::DEFAULT,
18577 mission_type: MavMissionType::DEFAULT,
18578 opaque_id: 0_u32,
18579 };
18580 #[cfg(feature = "arbitrary")]
18581 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18582 use arbitrary::{Arbitrary, Unstructured};
18583 let mut buf = [0u8; 1024];
18584 rng.fill_bytes(&mut buf);
18585 let mut unstructured = Unstructured::new(&buf);
18586 Self::arbitrary(&mut unstructured).unwrap_or_default()
18587 }
18588}
18589impl Default for MISSION_ACK_DATA {
18590 fn default() -> Self {
18591 Self::DEFAULT.clone()
18592 }
18593}
18594impl MessageData for MISSION_ACK_DATA {
18595 type Message = MavMessage;
18596 const ID: u32 = 47u32;
18597 const NAME: &'static str = "MISSION_ACK";
18598 const EXTRA_CRC: u8 = 153u8;
18599 const ENCODED_LEN: usize = 8usize;
18600 fn deser(
18601 _version: MavlinkVersion,
18602 __input: &[u8],
18603 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18604 let avail_len = __input.len();
18605 let mut payload_buf = [0; Self::ENCODED_LEN];
18606 let mut buf = if avail_len < Self::ENCODED_LEN {
18607 payload_buf[0..avail_len].copy_from_slice(__input);
18608 Bytes::new(&payload_buf)
18609 } else {
18610 Bytes::new(__input)
18611 };
18612 let mut __struct = Self::default();
18613 __struct.target_system = buf.get_u8();
18614 __struct.target_component = buf.get_u8();
18615 let tmp = buf.get_u8();
18616 __struct.mavtype =
18617 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18618 enum_type: "MavMissionResult",
18619 value: tmp as u32,
18620 })?;
18621 let tmp = buf.get_u8();
18622 __struct.mission_type =
18623 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18624 enum_type: "MavMissionType",
18625 value: tmp as u32,
18626 })?;
18627 __struct.opaque_id = buf.get_u32_le();
18628 Ok(__struct)
18629 }
18630 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18631 let mut __tmp = BytesMut::new(bytes);
18632 #[allow(clippy::absurd_extreme_comparisons)]
18633 #[allow(unused_comparisons)]
18634 if __tmp.remaining() < Self::ENCODED_LEN {
18635 panic!(
18636 "buffer is too small (need {} bytes, but got {})",
18637 Self::ENCODED_LEN,
18638 __tmp.remaining(),
18639 )
18640 }
18641 __tmp.put_u8(self.target_system);
18642 __tmp.put_u8(self.target_component);
18643 __tmp.put_u8(self.mavtype as u8);
18644 if matches!(version, MavlinkVersion::V2) {
18645 __tmp.put_u8(self.mission_type as u8);
18646 __tmp.put_u32_le(self.opaque_id);
18647 let len = __tmp.len();
18648 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18649 } else {
18650 __tmp.len()
18651 }
18652 }
18653}
18654#[doc = "Delete all mission items at once."]
18655#[doc = ""]
18656#[doc = "ID: 45"]
18657#[derive(Debug, Clone, PartialEq)]
18658#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18660pub struct MISSION_CLEAR_ALL_DATA {
18661 #[doc = "System ID"]
18662 pub target_system: u8,
18663 #[doc = "Component ID"]
18664 pub target_component: u8,
18665 #[doc = "Mission type."]
18666 #[cfg_attr(feature = "serde", serde(default))]
18667 pub mission_type: MavMissionType,
18668}
18669impl MISSION_CLEAR_ALL_DATA {
18670 pub const ENCODED_LEN: usize = 3usize;
18671 pub const DEFAULT: Self = Self {
18672 target_system: 0_u8,
18673 target_component: 0_u8,
18674 mission_type: MavMissionType::DEFAULT,
18675 };
18676 #[cfg(feature = "arbitrary")]
18677 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18678 use arbitrary::{Arbitrary, Unstructured};
18679 let mut buf = [0u8; 1024];
18680 rng.fill_bytes(&mut buf);
18681 let mut unstructured = Unstructured::new(&buf);
18682 Self::arbitrary(&mut unstructured).unwrap_or_default()
18683 }
18684}
18685impl Default for MISSION_CLEAR_ALL_DATA {
18686 fn default() -> Self {
18687 Self::DEFAULT.clone()
18688 }
18689}
18690impl MessageData for MISSION_CLEAR_ALL_DATA {
18691 type Message = MavMessage;
18692 const ID: u32 = 45u32;
18693 const NAME: &'static str = "MISSION_CLEAR_ALL";
18694 const EXTRA_CRC: u8 = 232u8;
18695 const ENCODED_LEN: usize = 3usize;
18696 fn deser(
18697 _version: MavlinkVersion,
18698 __input: &[u8],
18699 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18700 let avail_len = __input.len();
18701 let mut payload_buf = [0; Self::ENCODED_LEN];
18702 let mut buf = if avail_len < Self::ENCODED_LEN {
18703 payload_buf[0..avail_len].copy_from_slice(__input);
18704 Bytes::new(&payload_buf)
18705 } else {
18706 Bytes::new(__input)
18707 };
18708 let mut __struct = Self::default();
18709 __struct.target_system = buf.get_u8();
18710 __struct.target_component = buf.get_u8();
18711 let tmp = buf.get_u8();
18712 __struct.mission_type =
18713 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18714 enum_type: "MavMissionType",
18715 value: tmp as u32,
18716 })?;
18717 Ok(__struct)
18718 }
18719 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18720 let mut __tmp = BytesMut::new(bytes);
18721 #[allow(clippy::absurd_extreme_comparisons)]
18722 #[allow(unused_comparisons)]
18723 if __tmp.remaining() < Self::ENCODED_LEN {
18724 panic!(
18725 "buffer is too small (need {} bytes, but got {})",
18726 Self::ENCODED_LEN,
18727 __tmp.remaining(),
18728 )
18729 }
18730 __tmp.put_u8(self.target_system);
18731 __tmp.put_u8(self.target_component);
18732 if matches!(version, MavlinkVersion::V2) {
18733 __tmp.put_u8(self.mission_type as u8);
18734 let len = __tmp.len();
18735 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18736 } else {
18737 __tmp.len()
18738 }
18739 }
18740}
18741#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
18742#[doc = ""]
18743#[doc = "ID: 44"]
18744#[derive(Debug, Clone, PartialEq)]
18745#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18746#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18747pub struct MISSION_COUNT_DATA {
18748 #[doc = "Number of mission items in the sequence"]
18749 pub count: u16,
18750 #[doc = "System ID"]
18751 pub target_system: u8,
18752 #[doc = "Component ID"]
18753 pub target_component: u8,
18754 #[doc = "Mission type."]
18755 #[cfg_attr(feature = "serde", serde(default))]
18756 pub mission_type: MavMissionType,
18757 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
18758 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18759 pub opaque_id: u32,
18760}
18761impl MISSION_COUNT_DATA {
18762 pub const ENCODED_LEN: usize = 9usize;
18763 pub const DEFAULT: Self = Self {
18764 count: 0_u16,
18765 target_system: 0_u8,
18766 target_component: 0_u8,
18767 mission_type: MavMissionType::DEFAULT,
18768 opaque_id: 0_u32,
18769 };
18770 #[cfg(feature = "arbitrary")]
18771 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18772 use arbitrary::{Arbitrary, Unstructured};
18773 let mut buf = [0u8; 1024];
18774 rng.fill_bytes(&mut buf);
18775 let mut unstructured = Unstructured::new(&buf);
18776 Self::arbitrary(&mut unstructured).unwrap_or_default()
18777 }
18778}
18779impl Default for MISSION_COUNT_DATA {
18780 fn default() -> Self {
18781 Self::DEFAULT.clone()
18782 }
18783}
18784impl MessageData for MISSION_COUNT_DATA {
18785 type Message = MavMessage;
18786 const ID: u32 = 44u32;
18787 const NAME: &'static str = "MISSION_COUNT";
18788 const EXTRA_CRC: u8 = 221u8;
18789 const ENCODED_LEN: usize = 9usize;
18790 fn deser(
18791 _version: MavlinkVersion,
18792 __input: &[u8],
18793 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18794 let avail_len = __input.len();
18795 let mut payload_buf = [0; Self::ENCODED_LEN];
18796 let mut buf = if avail_len < Self::ENCODED_LEN {
18797 payload_buf[0..avail_len].copy_from_slice(__input);
18798 Bytes::new(&payload_buf)
18799 } else {
18800 Bytes::new(__input)
18801 };
18802 let mut __struct = Self::default();
18803 __struct.count = buf.get_u16_le();
18804 __struct.target_system = buf.get_u8();
18805 __struct.target_component = buf.get_u8();
18806 let tmp = buf.get_u8();
18807 __struct.mission_type =
18808 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18809 enum_type: "MavMissionType",
18810 value: tmp as u32,
18811 })?;
18812 __struct.opaque_id = buf.get_u32_le();
18813 Ok(__struct)
18814 }
18815 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18816 let mut __tmp = BytesMut::new(bytes);
18817 #[allow(clippy::absurd_extreme_comparisons)]
18818 #[allow(unused_comparisons)]
18819 if __tmp.remaining() < Self::ENCODED_LEN {
18820 panic!(
18821 "buffer is too small (need {} bytes, but got {})",
18822 Self::ENCODED_LEN,
18823 __tmp.remaining(),
18824 )
18825 }
18826 __tmp.put_u16_le(self.count);
18827 __tmp.put_u8(self.target_system);
18828 __tmp.put_u8(self.target_component);
18829 if matches!(version, MavlinkVersion::V2) {
18830 __tmp.put_u8(self.mission_type as u8);
18831 __tmp.put_u32_le(self.opaque_id);
18832 let len = __tmp.len();
18833 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18834 } else {
18835 __tmp.len()
18836 }
18837 }
18838}
18839#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
18840#[doc = ""]
18841#[doc = "ID: 42"]
18842#[derive(Debug, Clone, PartialEq)]
18843#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18844#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18845pub struct MISSION_CURRENT_DATA {
18846 #[doc = "Sequence"]
18847 pub seq: u16,
18848 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
18849 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18850 pub total: u16,
18851 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
18852 #[cfg_attr(feature = "serde", serde(default))]
18853 pub mission_state: MissionState,
18854 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
18855 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18856 pub mission_mode: u8,
18857 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
18858 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18859 pub mission_id: u32,
18860 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
18861 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18862 pub fence_id: u32,
18863 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
18864 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18865 pub rally_points_id: u32,
18866}
18867impl MISSION_CURRENT_DATA {
18868 pub const ENCODED_LEN: usize = 18usize;
18869 pub const DEFAULT: Self = Self {
18870 seq: 0_u16,
18871 total: 0_u16,
18872 mission_state: MissionState::DEFAULT,
18873 mission_mode: 0_u8,
18874 mission_id: 0_u32,
18875 fence_id: 0_u32,
18876 rally_points_id: 0_u32,
18877 };
18878 #[cfg(feature = "arbitrary")]
18879 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18880 use arbitrary::{Arbitrary, Unstructured};
18881 let mut buf = [0u8; 1024];
18882 rng.fill_bytes(&mut buf);
18883 let mut unstructured = Unstructured::new(&buf);
18884 Self::arbitrary(&mut unstructured).unwrap_or_default()
18885 }
18886}
18887impl Default for MISSION_CURRENT_DATA {
18888 fn default() -> Self {
18889 Self::DEFAULT.clone()
18890 }
18891}
18892impl MessageData for MISSION_CURRENT_DATA {
18893 type Message = MavMessage;
18894 const ID: u32 = 42u32;
18895 const NAME: &'static str = "MISSION_CURRENT";
18896 const EXTRA_CRC: u8 = 28u8;
18897 const ENCODED_LEN: usize = 18usize;
18898 fn deser(
18899 _version: MavlinkVersion,
18900 __input: &[u8],
18901 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18902 let avail_len = __input.len();
18903 let mut payload_buf = [0; Self::ENCODED_LEN];
18904 let mut buf = if avail_len < Self::ENCODED_LEN {
18905 payload_buf[0..avail_len].copy_from_slice(__input);
18906 Bytes::new(&payload_buf)
18907 } else {
18908 Bytes::new(__input)
18909 };
18910 let mut __struct = Self::default();
18911 __struct.seq = buf.get_u16_le();
18912 __struct.total = buf.get_u16_le();
18913 let tmp = buf.get_u8();
18914 __struct.mission_state =
18915 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18916 enum_type: "MissionState",
18917 value: tmp as u32,
18918 })?;
18919 __struct.mission_mode = buf.get_u8();
18920 __struct.mission_id = buf.get_u32_le();
18921 __struct.fence_id = buf.get_u32_le();
18922 __struct.rally_points_id = buf.get_u32_le();
18923 Ok(__struct)
18924 }
18925 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18926 let mut __tmp = BytesMut::new(bytes);
18927 #[allow(clippy::absurd_extreme_comparisons)]
18928 #[allow(unused_comparisons)]
18929 if __tmp.remaining() < Self::ENCODED_LEN {
18930 panic!(
18931 "buffer is too small (need {} bytes, but got {})",
18932 Self::ENCODED_LEN,
18933 __tmp.remaining(),
18934 )
18935 }
18936 __tmp.put_u16_le(self.seq);
18937 if matches!(version, MavlinkVersion::V2) {
18938 __tmp.put_u16_le(self.total);
18939 __tmp.put_u8(self.mission_state as u8);
18940 __tmp.put_u8(self.mission_mode);
18941 __tmp.put_u32_le(self.mission_id);
18942 __tmp.put_u32_le(self.fence_id);
18943 __tmp.put_u32_le(self.rally_points_id);
18944 let len = __tmp.len();
18945 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18946 } else {
18947 __tmp.len()
18948 }
18949 }
18950}
18951#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
18952#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
18953#[doc = ""]
18954#[doc = "ID: 39"]
18955#[derive(Debug, Clone, PartialEq)]
18956#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18957#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18958pub struct MISSION_ITEM_DATA {
18959 #[doc = "PARAM1, see MAV_CMD enum"]
18960 pub param1: f32,
18961 #[doc = "PARAM2, see MAV_CMD enum"]
18962 pub param2: f32,
18963 #[doc = "PARAM3, see MAV_CMD enum"]
18964 pub param3: f32,
18965 #[doc = "PARAM4, see MAV_CMD enum"]
18966 pub param4: f32,
18967 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
18968 pub x: f32,
18969 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
18970 pub y: f32,
18971 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
18972 pub z: f32,
18973 #[doc = "Sequence"]
18974 pub seq: u16,
18975 #[doc = "The scheduled action for the waypoint."]
18976 pub command: MavCmd,
18977 #[doc = "System ID"]
18978 pub target_system: u8,
18979 #[doc = "Component ID"]
18980 pub target_component: u8,
18981 #[doc = "The coordinate system of the waypoint."]
18982 pub frame: MavFrame,
18983 #[doc = "false:0, true:1"]
18984 pub current: u8,
18985 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
18986 pub autocontinue: u8,
18987 #[doc = "Mission type."]
18988 #[cfg_attr(feature = "serde", serde(default))]
18989 pub mission_type: MavMissionType,
18990}
18991impl MISSION_ITEM_DATA {
18992 pub const ENCODED_LEN: usize = 38usize;
18993 pub const DEFAULT: Self = Self {
18994 param1: 0.0_f32,
18995 param2: 0.0_f32,
18996 param3: 0.0_f32,
18997 param4: 0.0_f32,
18998 x: 0.0_f32,
18999 y: 0.0_f32,
19000 z: 0.0_f32,
19001 seq: 0_u16,
19002 command: MavCmd::DEFAULT,
19003 target_system: 0_u8,
19004 target_component: 0_u8,
19005 frame: MavFrame::DEFAULT,
19006 current: 0_u8,
19007 autocontinue: 0_u8,
19008 mission_type: MavMissionType::DEFAULT,
19009 };
19010 #[cfg(feature = "arbitrary")]
19011 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19012 use arbitrary::{Arbitrary, Unstructured};
19013 let mut buf = [0u8; 1024];
19014 rng.fill_bytes(&mut buf);
19015 let mut unstructured = Unstructured::new(&buf);
19016 Self::arbitrary(&mut unstructured).unwrap_or_default()
19017 }
19018}
19019impl Default for MISSION_ITEM_DATA {
19020 fn default() -> Self {
19021 Self::DEFAULT.clone()
19022 }
19023}
19024impl MessageData for MISSION_ITEM_DATA {
19025 type Message = MavMessage;
19026 const ID: u32 = 39u32;
19027 const NAME: &'static str = "MISSION_ITEM";
19028 const EXTRA_CRC: u8 = 254u8;
19029 const ENCODED_LEN: usize = 38usize;
19030 fn deser(
19031 _version: MavlinkVersion,
19032 __input: &[u8],
19033 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19034 let avail_len = __input.len();
19035 let mut payload_buf = [0; Self::ENCODED_LEN];
19036 let mut buf = if avail_len < Self::ENCODED_LEN {
19037 payload_buf[0..avail_len].copy_from_slice(__input);
19038 Bytes::new(&payload_buf)
19039 } else {
19040 Bytes::new(__input)
19041 };
19042 let mut __struct = Self::default();
19043 __struct.param1 = buf.get_f32_le();
19044 __struct.param2 = buf.get_f32_le();
19045 __struct.param3 = buf.get_f32_le();
19046 __struct.param4 = buf.get_f32_le();
19047 __struct.x = buf.get_f32_le();
19048 __struct.y = buf.get_f32_le();
19049 __struct.z = buf.get_f32_le();
19050 __struct.seq = buf.get_u16_le();
19051 let tmp = buf.get_u16_le();
19052 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19053 ::mavlink_core::error::ParserError::InvalidEnum {
19054 enum_type: "MavCmd",
19055 value: tmp as u32,
19056 },
19057 )?;
19058 __struct.target_system = buf.get_u8();
19059 __struct.target_component = buf.get_u8();
19060 let tmp = buf.get_u8();
19061 __struct.frame =
19062 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19063 enum_type: "MavFrame",
19064 value: tmp as u32,
19065 })?;
19066 __struct.current = buf.get_u8();
19067 __struct.autocontinue = buf.get_u8();
19068 let tmp = buf.get_u8();
19069 __struct.mission_type =
19070 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19071 enum_type: "MavMissionType",
19072 value: tmp as u32,
19073 })?;
19074 Ok(__struct)
19075 }
19076 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19077 let mut __tmp = BytesMut::new(bytes);
19078 #[allow(clippy::absurd_extreme_comparisons)]
19079 #[allow(unused_comparisons)]
19080 if __tmp.remaining() < Self::ENCODED_LEN {
19081 panic!(
19082 "buffer is too small (need {} bytes, but got {})",
19083 Self::ENCODED_LEN,
19084 __tmp.remaining(),
19085 )
19086 }
19087 __tmp.put_f32_le(self.param1);
19088 __tmp.put_f32_le(self.param2);
19089 __tmp.put_f32_le(self.param3);
19090 __tmp.put_f32_le(self.param4);
19091 __tmp.put_f32_le(self.x);
19092 __tmp.put_f32_le(self.y);
19093 __tmp.put_f32_le(self.z);
19094 __tmp.put_u16_le(self.seq);
19095 __tmp.put_u16_le(self.command as u16);
19096 __tmp.put_u8(self.target_system);
19097 __tmp.put_u8(self.target_component);
19098 __tmp.put_u8(self.frame as u8);
19099 __tmp.put_u8(self.current);
19100 __tmp.put_u8(self.autocontinue);
19101 if matches!(version, MavlinkVersion::V2) {
19102 __tmp.put_u8(self.mission_type as u8);
19103 let len = __tmp.len();
19104 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19105 } else {
19106 __tmp.len()
19107 }
19108 }
19109}
19110#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19111#[doc = ""]
19112#[doc = "ID: 73"]
19113#[derive(Debug, Clone, PartialEq)]
19114#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19115#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19116pub struct MISSION_ITEM_INT_DATA {
19117 #[doc = "PARAM1, see MAV_CMD enum"]
19118 pub param1: f32,
19119 #[doc = "PARAM2, see MAV_CMD enum"]
19120 pub param2: f32,
19121 #[doc = "PARAM3, see MAV_CMD enum"]
19122 pub param3: f32,
19123 #[doc = "PARAM4, see MAV_CMD enum"]
19124 pub param4: f32,
19125 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
19126 pub x: i32,
19127 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19128 pub y: i32,
19129 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19130 pub z: f32,
19131 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19132 pub seq: u16,
19133 #[doc = "The scheduled action for the waypoint."]
19134 pub command: MavCmd,
19135 #[doc = "System ID"]
19136 pub target_system: u8,
19137 #[doc = "Component ID"]
19138 pub target_component: u8,
19139 #[doc = "The coordinate system of the waypoint."]
19140 pub frame: MavFrame,
19141 #[doc = "false:0, true:1"]
19142 pub current: u8,
19143 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19144 pub autocontinue: u8,
19145 #[doc = "Mission type."]
19146 #[cfg_attr(feature = "serde", serde(default))]
19147 pub mission_type: MavMissionType,
19148}
19149impl MISSION_ITEM_INT_DATA {
19150 pub const ENCODED_LEN: usize = 38usize;
19151 pub const DEFAULT: Self = Self {
19152 param1: 0.0_f32,
19153 param2: 0.0_f32,
19154 param3: 0.0_f32,
19155 param4: 0.0_f32,
19156 x: 0_i32,
19157 y: 0_i32,
19158 z: 0.0_f32,
19159 seq: 0_u16,
19160 command: MavCmd::DEFAULT,
19161 target_system: 0_u8,
19162 target_component: 0_u8,
19163 frame: MavFrame::DEFAULT,
19164 current: 0_u8,
19165 autocontinue: 0_u8,
19166 mission_type: MavMissionType::DEFAULT,
19167 };
19168 #[cfg(feature = "arbitrary")]
19169 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19170 use arbitrary::{Arbitrary, Unstructured};
19171 let mut buf = [0u8; 1024];
19172 rng.fill_bytes(&mut buf);
19173 let mut unstructured = Unstructured::new(&buf);
19174 Self::arbitrary(&mut unstructured).unwrap_or_default()
19175 }
19176}
19177impl Default for MISSION_ITEM_INT_DATA {
19178 fn default() -> Self {
19179 Self::DEFAULT.clone()
19180 }
19181}
19182impl MessageData for MISSION_ITEM_INT_DATA {
19183 type Message = MavMessage;
19184 const ID: u32 = 73u32;
19185 const NAME: &'static str = "MISSION_ITEM_INT";
19186 const EXTRA_CRC: u8 = 38u8;
19187 const ENCODED_LEN: usize = 38usize;
19188 fn deser(
19189 _version: MavlinkVersion,
19190 __input: &[u8],
19191 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19192 let avail_len = __input.len();
19193 let mut payload_buf = [0; Self::ENCODED_LEN];
19194 let mut buf = if avail_len < Self::ENCODED_LEN {
19195 payload_buf[0..avail_len].copy_from_slice(__input);
19196 Bytes::new(&payload_buf)
19197 } else {
19198 Bytes::new(__input)
19199 };
19200 let mut __struct = Self::default();
19201 __struct.param1 = buf.get_f32_le();
19202 __struct.param2 = buf.get_f32_le();
19203 __struct.param3 = buf.get_f32_le();
19204 __struct.param4 = buf.get_f32_le();
19205 __struct.x = buf.get_i32_le();
19206 __struct.y = buf.get_i32_le();
19207 __struct.z = buf.get_f32_le();
19208 __struct.seq = buf.get_u16_le();
19209 let tmp = buf.get_u16_le();
19210 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19211 ::mavlink_core::error::ParserError::InvalidEnum {
19212 enum_type: "MavCmd",
19213 value: tmp as u32,
19214 },
19215 )?;
19216 __struct.target_system = buf.get_u8();
19217 __struct.target_component = buf.get_u8();
19218 let tmp = buf.get_u8();
19219 __struct.frame =
19220 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19221 enum_type: "MavFrame",
19222 value: tmp as u32,
19223 })?;
19224 __struct.current = buf.get_u8();
19225 __struct.autocontinue = buf.get_u8();
19226 let tmp = buf.get_u8();
19227 __struct.mission_type =
19228 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19229 enum_type: "MavMissionType",
19230 value: tmp as u32,
19231 })?;
19232 Ok(__struct)
19233 }
19234 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19235 let mut __tmp = BytesMut::new(bytes);
19236 #[allow(clippy::absurd_extreme_comparisons)]
19237 #[allow(unused_comparisons)]
19238 if __tmp.remaining() < Self::ENCODED_LEN {
19239 panic!(
19240 "buffer is too small (need {} bytes, but got {})",
19241 Self::ENCODED_LEN,
19242 __tmp.remaining(),
19243 )
19244 }
19245 __tmp.put_f32_le(self.param1);
19246 __tmp.put_f32_le(self.param2);
19247 __tmp.put_f32_le(self.param3);
19248 __tmp.put_f32_le(self.param4);
19249 __tmp.put_i32_le(self.x);
19250 __tmp.put_i32_le(self.y);
19251 __tmp.put_f32_le(self.z);
19252 __tmp.put_u16_le(self.seq);
19253 __tmp.put_u16_le(self.command as u16);
19254 __tmp.put_u8(self.target_system);
19255 __tmp.put_u8(self.target_component);
19256 __tmp.put_u8(self.frame as u8);
19257 __tmp.put_u8(self.current);
19258 __tmp.put_u8(self.autocontinue);
19259 if matches!(version, MavlinkVersion::V2) {
19260 __tmp.put_u8(self.mission_type as u8);
19261 let len = __tmp.len();
19262 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19263 } else {
19264 __tmp.len()
19265 }
19266 }
19267}
19268#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
19269#[doc = ""]
19270#[doc = "ID: 46"]
19271#[derive(Debug, Clone, PartialEq)]
19272#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19274pub struct MISSION_ITEM_REACHED_DATA {
19275 #[doc = "Sequence"]
19276 pub seq: u16,
19277}
19278impl MISSION_ITEM_REACHED_DATA {
19279 pub const ENCODED_LEN: usize = 2usize;
19280 pub const DEFAULT: Self = Self { seq: 0_u16 };
19281 #[cfg(feature = "arbitrary")]
19282 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19283 use arbitrary::{Arbitrary, Unstructured};
19284 let mut buf = [0u8; 1024];
19285 rng.fill_bytes(&mut buf);
19286 let mut unstructured = Unstructured::new(&buf);
19287 Self::arbitrary(&mut unstructured).unwrap_or_default()
19288 }
19289}
19290impl Default for MISSION_ITEM_REACHED_DATA {
19291 fn default() -> Self {
19292 Self::DEFAULT.clone()
19293 }
19294}
19295impl MessageData for MISSION_ITEM_REACHED_DATA {
19296 type Message = MavMessage;
19297 const ID: u32 = 46u32;
19298 const NAME: &'static str = "MISSION_ITEM_REACHED";
19299 const EXTRA_CRC: u8 = 11u8;
19300 const ENCODED_LEN: usize = 2usize;
19301 fn deser(
19302 _version: MavlinkVersion,
19303 __input: &[u8],
19304 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19305 let avail_len = __input.len();
19306 let mut payload_buf = [0; Self::ENCODED_LEN];
19307 let mut buf = if avail_len < Self::ENCODED_LEN {
19308 payload_buf[0..avail_len].copy_from_slice(__input);
19309 Bytes::new(&payload_buf)
19310 } else {
19311 Bytes::new(__input)
19312 };
19313 let mut __struct = Self::default();
19314 __struct.seq = buf.get_u16_le();
19315 Ok(__struct)
19316 }
19317 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19318 let mut __tmp = BytesMut::new(bytes);
19319 #[allow(clippy::absurd_extreme_comparisons)]
19320 #[allow(unused_comparisons)]
19321 if __tmp.remaining() < Self::ENCODED_LEN {
19322 panic!(
19323 "buffer is too small (need {} bytes, but got {})",
19324 Self::ENCODED_LEN,
19325 __tmp.remaining(),
19326 )
19327 }
19328 __tmp.put_u16_le(self.seq);
19329 if matches!(version, MavlinkVersion::V2) {
19330 let len = __tmp.len();
19331 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19332 } else {
19333 __tmp.len()
19334 }
19335 }
19336}
19337#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
19338#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
19339#[doc = ""]
19340#[doc = "ID: 40"]
19341#[derive(Debug, Clone, PartialEq)]
19342#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19344pub struct MISSION_REQUEST_DATA {
19345 #[doc = "Sequence"]
19346 pub seq: u16,
19347 #[doc = "System ID"]
19348 pub target_system: u8,
19349 #[doc = "Component ID"]
19350 pub target_component: u8,
19351 #[doc = "Mission type."]
19352 #[cfg_attr(feature = "serde", serde(default))]
19353 pub mission_type: MavMissionType,
19354}
19355impl MISSION_REQUEST_DATA {
19356 pub const ENCODED_LEN: usize = 5usize;
19357 pub const DEFAULT: Self = Self {
19358 seq: 0_u16,
19359 target_system: 0_u8,
19360 target_component: 0_u8,
19361 mission_type: MavMissionType::DEFAULT,
19362 };
19363 #[cfg(feature = "arbitrary")]
19364 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19365 use arbitrary::{Arbitrary, Unstructured};
19366 let mut buf = [0u8; 1024];
19367 rng.fill_bytes(&mut buf);
19368 let mut unstructured = Unstructured::new(&buf);
19369 Self::arbitrary(&mut unstructured).unwrap_or_default()
19370 }
19371}
19372impl Default for MISSION_REQUEST_DATA {
19373 fn default() -> Self {
19374 Self::DEFAULT.clone()
19375 }
19376}
19377impl MessageData for MISSION_REQUEST_DATA {
19378 type Message = MavMessage;
19379 const ID: u32 = 40u32;
19380 const NAME: &'static str = "MISSION_REQUEST";
19381 const EXTRA_CRC: u8 = 230u8;
19382 const ENCODED_LEN: usize = 5usize;
19383 fn deser(
19384 _version: MavlinkVersion,
19385 __input: &[u8],
19386 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19387 let avail_len = __input.len();
19388 let mut payload_buf = [0; Self::ENCODED_LEN];
19389 let mut buf = if avail_len < Self::ENCODED_LEN {
19390 payload_buf[0..avail_len].copy_from_slice(__input);
19391 Bytes::new(&payload_buf)
19392 } else {
19393 Bytes::new(__input)
19394 };
19395 let mut __struct = Self::default();
19396 __struct.seq = buf.get_u16_le();
19397 __struct.target_system = buf.get_u8();
19398 __struct.target_component = buf.get_u8();
19399 let tmp = buf.get_u8();
19400 __struct.mission_type =
19401 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19402 enum_type: "MavMissionType",
19403 value: tmp as u32,
19404 })?;
19405 Ok(__struct)
19406 }
19407 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19408 let mut __tmp = BytesMut::new(bytes);
19409 #[allow(clippy::absurd_extreme_comparisons)]
19410 #[allow(unused_comparisons)]
19411 if __tmp.remaining() < Self::ENCODED_LEN {
19412 panic!(
19413 "buffer is too small (need {} bytes, but got {})",
19414 Self::ENCODED_LEN,
19415 __tmp.remaining(),
19416 )
19417 }
19418 __tmp.put_u16_le(self.seq);
19419 __tmp.put_u8(self.target_system);
19420 __tmp.put_u8(self.target_component);
19421 if matches!(version, MavlinkVersion::V2) {
19422 __tmp.put_u8(self.mission_type as u8);
19423 let len = __tmp.len();
19424 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19425 } else {
19426 __tmp.len()
19427 }
19428 }
19429}
19430#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
19431#[doc = ""]
19432#[doc = "ID: 51"]
19433#[derive(Debug, Clone, PartialEq)]
19434#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19436pub struct MISSION_REQUEST_INT_DATA {
19437 #[doc = "Sequence"]
19438 pub seq: u16,
19439 #[doc = "System ID"]
19440 pub target_system: u8,
19441 #[doc = "Component ID"]
19442 pub target_component: u8,
19443 #[doc = "Mission type."]
19444 #[cfg_attr(feature = "serde", serde(default))]
19445 pub mission_type: MavMissionType,
19446}
19447impl MISSION_REQUEST_INT_DATA {
19448 pub const ENCODED_LEN: usize = 5usize;
19449 pub const DEFAULT: Self = Self {
19450 seq: 0_u16,
19451 target_system: 0_u8,
19452 target_component: 0_u8,
19453 mission_type: MavMissionType::DEFAULT,
19454 };
19455 #[cfg(feature = "arbitrary")]
19456 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19457 use arbitrary::{Arbitrary, Unstructured};
19458 let mut buf = [0u8; 1024];
19459 rng.fill_bytes(&mut buf);
19460 let mut unstructured = Unstructured::new(&buf);
19461 Self::arbitrary(&mut unstructured).unwrap_or_default()
19462 }
19463}
19464impl Default for MISSION_REQUEST_INT_DATA {
19465 fn default() -> Self {
19466 Self::DEFAULT.clone()
19467 }
19468}
19469impl MessageData for MISSION_REQUEST_INT_DATA {
19470 type Message = MavMessage;
19471 const ID: u32 = 51u32;
19472 const NAME: &'static str = "MISSION_REQUEST_INT";
19473 const EXTRA_CRC: u8 = 196u8;
19474 const ENCODED_LEN: usize = 5usize;
19475 fn deser(
19476 _version: MavlinkVersion,
19477 __input: &[u8],
19478 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19479 let avail_len = __input.len();
19480 let mut payload_buf = [0; Self::ENCODED_LEN];
19481 let mut buf = if avail_len < Self::ENCODED_LEN {
19482 payload_buf[0..avail_len].copy_from_slice(__input);
19483 Bytes::new(&payload_buf)
19484 } else {
19485 Bytes::new(__input)
19486 };
19487 let mut __struct = Self::default();
19488 __struct.seq = buf.get_u16_le();
19489 __struct.target_system = buf.get_u8();
19490 __struct.target_component = buf.get_u8();
19491 let tmp = buf.get_u8();
19492 __struct.mission_type =
19493 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19494 enum_type: "MavMissionType",
19495 value: tmp as u32,
19496 })?;
19497 Ok(__struct)
19498 }
19499 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19500 let mut __tmp = BytesMut::new(bytes);
19501 #[allow(clippy::absurd_extreme_comparisons)]
19502 #[allow(unused_comparisons)]
19503 if __tmp.remaining() < Self::ENCODED_LEN {
19504 panic!(
19505 "buffer is too small (need {} bytes, but got {})",
19506 Self::ENCODED_LEN,
19507 __tmp.remaining(),
19508 )
19509 }
19510 __tmp.put_u16_le(self.seq);
19511 __tmp.put_u8(self.target_system);
19512 __tmp.put_u8(self.target_component);
19513 if matches!(version, MavlinkVersion::V2) {
19514 __tmp.put_u8(self.mission_type as u8);
19515 let len = __tmp.len();
19516 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19517 } else {
19518 __tmp.len()
19519 }
19520 }
19521}
19522#[doc = "Request the overall list of mission items from the system/component."]
19523#[doc = ""]
19524#[doc = "ID: 43"]
19525#[derive(Debug, Clone, PartialEq)]
19526#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19527#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19528pub struct MISSION_REQUEST_LIST_DATA {
19529 #[doc = "System ID"]
19530 pub target_system: u8,
19531 #[doc = "Component ID"]
19532 pub target_component: u8,
19533 #[doc = "Mission type."]
19534 #[cfg_attr(feature = "serde", serde(default))]
19535 pub mission_type: MavMissionType,
19536}
19537impl MISSION_REQUEST_LIST_DATA {
19538 pub const ENCODED_LEN: usize = 3usize;
19539 pub const DEFAULT: Self = Self {
19540 target_system: 0_u8,
19541 target_component: 0_u8,
19542 mission_type: MavMissionType::DEFAULT,
19543 };
19544 #[cfg(feature = "arbitrary")]
19545 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19546 use arbitrary::{Arbitrary, Unstructured};
19547 let mut buf = [0u8; 1024];
19548 rng.fill_bytes(&mut buf);
19549 let mut unstructured = Unstructured::new(&buf);
19550 Self::arbitrary(&mut unstructured).unwrap_or_default()
19551 }
19552}
19553impl Default for MISSION_REQUEST_LIST_DATA {
19554 fn default() -> Self {
19555 Self::DEFAULT.clone()
19556 }
19557}
19558impl MessageData for MISSION_REQUEST_LIST_DATA {
19559 type Message = MavMessage;
19560 const ID: u32 = 43u32;
19561 const NAME: &'static str = "MISSION_REQUEST_LIST";
19562 const EXTRA_CRC: u8 = 132u8;
19563 const ENCODED_LEN: usize = 3usize;
19564 fn deser(
19565 _version: MavlinkVersion,
19566 __input: &[u8],
19567 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19568 let avail_len = __input.len();
19569 let mut payload_buf = [0; Self::ENCODED_LEN];
19570 let mut buf = if avail_len < Self::ENCODED_LEN {
19571 payload_buf[0..avail_len].copy_from_slice(__input);
19572 Bytes::new(&payload_buf)
19573 } else {
19574 Bytes::new(__input)
19575 };
19576 let mut __struct = Self::default();
19577 __struct.target_system = buf.get_u8();
19578 __struct.target_component = buf.get_u8();
19579 let tmp = buf.get_u8();
19580 __struct.mission_type =
19581 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19582 enum_type: "MavMissionType",
19583 value: tmp as u32,
19584 })?;
19585 Ok(__struct)
19586 }
19587 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19588 let mut __tmp = BytesMut::new(bytes);
19589 #[allow(clippy::absurd_extreme_comparisons)]
19590 #[allow(unused_comparisons)]
19591 if __tmp.remaining() < Self::ENCODED_LEN {
19592 panic!(
19593 "buffer is too small (need {} bytes, but got {})",
19594 Self::ENCODED_LEN,
19595 __tmp.remaining(),
19596 )
19597 }
19598 __tmp.put_u8(self.target_system);
19599 __tmp.put_u8(self.target_component);
19600 if matches!(version, MavlinkVersion::V2) {
19601 __tmp.put_u8(self.mission_type as u8);
19602 let len = __tmp.len();
19603 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19604 } else {
19605 __tmp.len()
19606 }
19607 }
19608}
19609#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
19610#[doc = ""]
19611#[doc = "ID: 37"]
19612#[derive(Debug, Clone, PartialEq)]
19613#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19614#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19615pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
19616 #[doc = "Start index"]
19617 pub start_index: i16,
19618 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
19619 pub end_index: i16,
19620 #[doc = "System ID"]
19621 pub target_system: u8,
19622 #[doc = "Component ID"]
19623 pub target_component: u8,
19624 #[doc = "Mission type."]
19625 #[cfg_attr(feature = "serde", serde(default))]
19626 pub mission_type: MavMissionType,
19627}
19628impl MISSION_REQUEST_PARTIAL_LIST_DATA {
19629 pub const ENCODED_LEN: usize = 7usize;
19630 pub const DEFAULT: Self = Self {
19631 start_index: 0_i16,
19632 end_index: 0_i16,
19633 target_system: 0_u8,
19634 target_component: 0_u8,
19635 mission_type: MavMissionType::DEFAULT,
19636 };
19637 #[cfg(feature = "arbitrary")]
19638 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19639 use arbitrary::{Arbitrary, Unstructured};
19640 let mut buf = [0u8; 1024];
19641 rng.fill_bytes(&mut buf);
19642 let mut unstructured = Unstructured::new(&buf);
19643 Self::arbitrary(&mut unstructured).unwrap_or_default()
19644 }
19645}
19646impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
19647 fn default() -> Self {
19648 Self::DEFAULT.clone()
19649 }
19650}
19651impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
19652 type Message = MavMessage;
19653 const ID: u32 = 37u32;
19654 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
19655 const EXTRA_CRC: u8 = 212u8;
19656 const ENCODED_LEN: usize = 7usize;
19657 fn deser(
19658 _version: MavlinkVersion,
19659 __input: &[u8],
19660 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19661 let avail_len = __input.len();
19662 let mut payload_buf = [0; Self::ENCODED_LEN];
19663 let mut buf = if avail_len < Self::ENCODED_LEN {
19664 payload_buf[0..avail_len].copy_from_slice(__input);
19665 Bytes::new(&payload_buf)
19666 } else {
19667 Bytes::new(__input)
19668 };
19669 let mut __struct = Self::default();
19670 __struct.start_index = buf.get_i16_le();
19671 __struct.end_index = buf.get_i16_le();
19672 __struct.target_system = buf.get_u8();
19673 __struct.target_component = buf.get_u8();
19674 let tmp = buf.get_u8();
19675 __struct.mission_type =
19676 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19677 enum_type: "MavMissionType",
19678 value: tmp as u32,
19679 })?;
19680 Ok(__struct)
19681 }
19682 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19683 let mut __tmp = BytesMut::new(bytes);
19684 #[allow(clippy::absurd_extreme_comparisons)]
19685 #[allow(unused_comparisons)]
19686 if __tmp.remaining() < Self::ENCODED_LEN {
19687 panic!(
19688 "buffer is too small (need {} bytes, but got {})",
19689 Self::ENCODED_LEN,
19690 __tmp.remaining(),
19691 )
19692 }
19693 __tmp.put_i16_le(self.start_index);
19694 __tmp.put_i16_le(self.end_index);
19695 __tmp.put_u8(self.target_system);
19696 __tmp.put_u8(self.target_component);
19697 if matches!(version, MavlinkVersion::V2) {
19698 __tmp.put_u8(self.mission_type as u8);
19699 let len = __tmp.len();
19700 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19701 } else {
19702 __tmp.len()
19703 }
19704 }
19705}
19706#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
19707#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
19708#[doc = ""]
19709#[doc = "ID: 41"]
19710#[derive(Debug, Clone, PartialEq)]
19711#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19712#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19713pub struct MISSION_SET_CURRENT_DATA {
19714 #[doc = "Sequence"]
19715 pub seq: u16,
19716 #[doc = "System ID"]
19717 pub target_system: u8,
19718 #[doc = "Component ID"]
19719 pub target_component: u8,
19720}
19721impl MISSION_SET_CURRENT_DATA {
19722 pub const ENCODED_LEN: usize = 4usize;
19723 pub const DEFAULT: Self = Self {
19724 seq: 0_u16,
19725 target_system: 0_u8,
19726 target_component: 0_u8,
19727 };
19728 #[cfg(feature = "arbitrary")]
19729 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19730 use arbitrary::{Arbitrary, Unstructured};
19731 let mut buf = [0u8; 1024];
19732 rng.fill_bytes(&mut buf);
19733 let mut unstructured = Unstructured::new(&buf);
19734 Self::arbitrary(&mut unstructured).unwrap_or_default()
19735 }
19736}
19737impl Default for MISSION_SET_CURRENT_DATA {
19738 fn default() -> Self {
19739 Self::DEFAULT.clone()
19740 }
19741}
19742impl MessageData for MISSION_SET_CURRENT_DATA {
19743 type Message = MavMessage;
19744 const ID: u32 = 41u32;
19745 const NAME: &'static str = "MISSION_SET_CURRENT";
19746 const EXTRA_CRC: u8 = 28u8;
19747 const ENCODED_LEN: usize = 4usize;
19748 fn deser(
19749 _version: MavlinkVersion,
19750 __input: &[u8],
19751 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19752 let avail_len = __input.len();
19753 let mut payload_buf = [0; Self::ENCODED_LEN];
19754 let mut buf = if avail_len < Self::ENCODED_LEN {
19755 payload_buf[0..avail_len].copy_from_slice(__input);
19756 Bytes::new(&payload_buf)
19757 } else {
19758 Bytes::new(__input)
19759 };
19760 let mut __struct = Self::default();
19761 __struct.seq = buf.get_u16_le();
19762 __struct.target_system = buf.get_u8();
19763 __struct.target_component = buf.get_u8();
19764 Ok(__struct)
19765 }
19766 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19767 let mut __tmp = BytesMut::new(bytes);
19768 #[allow(clippy::absurd_extreme_comparisons)]
19769 #[allow(unused_comparisons)]
19770 if __tmp.remaining() < Self::ENCODED_LEN {
19771 panic!(
19772 "buffer is too small (need {} bytes, but got {})",
19773 Self::ENCODED_LEN,
19774 __tmp.remaining(),
19775 )
19776 }
19777 __tmp.put_u16_le(self.seq);
19778 __tmp.put_u8(self.target_system);
19779 __tmp.put_u8(self.target_component);
19780 if matches!(version, MavlinkVersion::V2) {
19781 let len = __tmp.len();
19782 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19783 } else {
19784 __tmp.len()
19785 }
19786 }
19787}
19788#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
19789#[doc = ""]
19790#[doc = "ID: 38"]
19791#[derive(Debug, Clone, PartialEq)]
19792#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19793#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19794pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
19795 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
19796 pub start_index: i16,
19797 #[doc = "End index, equal or greater than start index."]
19798 pub end_index: i16,
19799 #[doc = "System ID"]
19800 pub target_system: u8,
19801 #[doc = "Component ID"]
19802 pub target_component: u8,
19803 #[doc = "Mission type."]
19804 #[cfg_attr(feature = "serde", serde(default))]
19805 pub mission_type: MavMissionType,
19806}
19807impl MISSION_WRITE_PARTIAL_LIST_DATA {
19808 pub const ENCODED_LEN: usize = 7usize;
19809 pub const DEFAULT: Self = Self {
19810 start_index: 0_i16,
19811 end_index: 0_i16,
19812 target_system: 0_u8,
19813 target_component: 0_u8,
19814 mission_type: MavMissionType::DEFAULT,
19815 };
19816 #[cfg(feature = "arbitrary")]
19817 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19818 use arbitrary::{Arbitrary, Unstructured};
19819 let mut buf = [0u8; 1024];
19820 rng.fill_bytes(&mut buf);
19821 let mut unstructured = Unstructured::new(&buf);
19822 Self::arbitrary(&mut unstructured).unwrap_or_default()
19823 }
19824}
19825impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
19826 fn default() -> Self {
19827 Self::DEFAULT.clone()
19828 }
19829}
19830impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
19831 type Message = MavMessage;
19832 const ID: u32 = 38u32;
19833 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
19834 const EXTRA_CRC: u8 = 9u8;
19835 const ENCODED_LEN: usize = 7usize;
19836 fn deser(
19837 _version: MavlinkVersion,
19838 __input: &[u8],
19839 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19840 let avail_len = __input.len();
19841 let mut payload_buf = [0; Self::ENCODED_LEN];
19842 let mut buf = if avail_len < Self::ENCODED_LEN {
19843 payload_buf[0..avail_len].copy_from_slice(__input);
19844 Bytes::new(&payload_buf)
19845 } else {
19846 Bytes::new(__input)
19847 };
19848 let mut __struct = Self::default();
19849 __struct.start_index = buf.get_i16_le();
19850 __struct.end_index = buf.get_i16_le();
19851 __struct.target_system = buf.get_u8();
19852 __struct.target_component = buf.get_u8();
19853 let tmp = buf.get_u8();
19854 __struct.mission_type =
19855 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19856 enum_type: "MavMissionType",
19857 value: tmp as u32,
19858 })?;
19859 Ok(__struct)
19860 }
19861 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19862 let mut __tmp = BytesMut::new(bytes);
19863 #[allow(clippy::absurd_extreme_comparisons)]
19864 #[allow(unused_comparisons)]
19865 if __tmp.remaining() < Self::ENCODED_LEN {
19866 panic!(
19867 "buffer is too small (need {} bytes, but got {})",
19868 Self::ENCODED_LEN,
19869 __tmp.remaining(),
19870 )
19871 }
19872 __tmp.put_i16_le(self.start_index);
19873 __tmp.put_i16_le(self.end_index);
19874 __tmp.put_u8(self.target_system);
19875 __tmp.put_u8(self.target_component);
19876 if matches!(version, MavlinkVersion::V2) {
19877 __tmp.put_u8(self.mission_type as u8);
19878 let len = __tmp.len();
19879 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19880 } else {
19881 __tmp.len()
19882 }
19883 }
19884}
19885#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
19886#[doc = "Orientation of a mount."]
19887#[doc = ""]
19888#[doc = "ID: 265"]
19889#[derive(Debug, Clone, PartialEq)]
19890#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19891#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19892pub struct MOUNT_ORIENTATION_DATA {
19893 #[doc = "Timestamp (time since system boot)."]
19894 pub time_boot_ms: u32,
19895 #[doc = "Roll in global frame (set to NaN for invalid)."]
19896 pub roll: f32,
19897 #[doc = "Pitch in global frame (set to NaN for invalid)."]
19898 pub pitch: f32,
19899 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
19900 pub yaw: f32,
19901 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
19902 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19903 pub yaw_absolute: f32,
19904}
19905impl MOUNT_ORIENTATION_DATA {
19906 pub const ENCODED_LEN: usize = 20usize;
19907 pub const DEFAULT: Self = Self {
19908 time_boot_ms: 0_u32,
19909 roll: 0.0_f32,
19910 pitch: 0.0_f32,
19911 yaw: 0.0_f32,
19912 yaw_absolute: 0.0_f32,
19913 };
19914 #[cfg(feature = "arbitrary")]
19915 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19916 use arbitrary::{Arbitrary, Unstructured};
19917 let mut buf = [0u8; 1024];
19918 rng.fill_bytes(&mut buf);
19919 let mut unstructured = Unstructured::new(&buf);
19920 Self::arbitrary(&mut unstructured).unwrap_or_default()
19921 }
19922}
19923impl Default for MOUNT_ORIENTATION_DATA {
19924 fn default() -> Self {
19925 Self::DEFAULT.clone()
19926 }
19927}
19928impl MessageData for MOUNT_ORIENTATION_DATA {
19929 type Message = MavMessage;
19930 const ID: u32 = 265u32;
19931 const NAME: &'static str = "MOUNT_ORIENTATION";
19932 const EXTRA_CRC: u8 = 26u8;
19933 const ENCODED_LEN: usize = 20usize;
19934 fn deser(
19935 _version: MavlinkVersion,
19936 __input: &[u8],
19937 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19938 let avail_len = __input.len();
19939 let mut payload_buf = [0; Self::ENCODED_LEN];
19940 let mut buf = if avail_len < Self::ENCODED_LEN {
19941 payload_buf[0..avail_len].copy_from_slice(__input);
19942 Bytes::new(&payload_buf)
19943 } else {
19944 Bytes::new(__input)
19945 };
19946 let mut __struct = Self::default();
19947 __struct.time_boot_ms = buf.get_u32_le();
19948 __struct.roll = buf.get_f32_le();
19949 __struct.pitch = buf.get_f32_le();
19950 __struct.yaw = buf.get_f32_le();
19951 __struct.yaw_absolute = buf.get_f32_le();
19952 Ok(__struct)
19953 }
19954 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19955 let mut __tmp = BytesMut::new(bytes);
19956 #[allow(clippy::absurd_extreme_comparisons)]
19957 #[allow(unused_comparisons)]
19958 if __tmp.remaining() < Self::ENCODED_LEN {
19959 panic!(
19960 "buffer is too small (need {} bytes, but got {})",
19961 Self::ENCODED_LEN,
19962 __tmp.remaining(),
19963 )
19964 }
19965 __tmp.put_u32_le(self.time_boot_ms);
19966 __tmp.put_f32_le(self.roll);
19967 __tmp.put_f32_le(self.pitch);
19968 __tmp.put_f32_le(self.yaw);
19969 if matches!(version, MavlinkVersion::V2) {
19970 __tmp.put_f32_le(self.yaw_absolute);
19971 let len = __tmp.len();
19972 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19973 } else {
19974 __tmp.len()
19975 }
19976 }
19977}
19978#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19979#[doc = ""]
19980#[doc = "ID: 251"]
19981#[derive(Debug, Clone, PartialEq)]
19982#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19984pub struct NAMED_VALUE_FLOAT_DATA {
19985 #[doc = "Timestamp (time since system boot)."]
19986 pub time_boot_ms: u32,
19987 #[doc = "Floating point value"]
19988 pub value: f32,
19989 #[doc = "Name of the debug variable"]
19990 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19991 pub name: [u8; 10],
19992}
19993impl NAMED_VALUE_FLOAT_DATA {
19994 pub const ENCODED_LEN: usize = 18usize;
19995 pub const DEFAULT: Self = Self {
19996 time_boot_ms: 0_u32,
19997 value: 0.0_f32,
19998 name: [0_u8; 10usize],
19999 };
20000 #[cfg(feature = "arbitrary")]
20001 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20002 use arbitrary::{Arbitrary, Unstructured};
20003 let mut buf = [0u8; 1024];
20004 rng.fill_bytes(&mut buf);
20005 let mut unstructured = Unstructured::new(&buf);
20006 Self::arbitrary(&mut unstructured).unwrap_or_default()
20007 }
20008}
20009impl Default for NAMED_VALUE_FLOAT_DATA {
20010 fn default() -> Self {
20011 Self::DEFAULT.clone()
20012 }
20013}
20014impl MessageData for NAMED_VALUE_FLOAT_DATA {
20015 type Message = MavMessage;
20016 const ID: u32 = 251u32;
20017 const NAME: &'static str = "NAMED_VALUE_FLOAT";
20018 const EXTRA_CRC: u8 = 170u8;
20019 const ENCODED_LEN: usize = 18usize;
20020 fn deser(
20021 _version: MavlinkVersion,
20022 __input: &[u8],
20023 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20024 let avail_len = __input.len();
20025 let mut payload_buf = [0; Self::ENCODED_LEN];
20026 let mut buf = if avail_len < Self::ENCODED_LEN {
20027 payload_buf[0..avail_len].copy_from_slice(__input);
20028 Bytes::new(&payload_buf)
20029 } else {
20030 Bytes::new(__input)
20031 };
20032 let mut __struct = Self::default();
20033 __struct.time_boot_ms = buf.get_u32_le();
20034 __struct.value = buf.get_f32_le();
20035 for v in &mut __struct.name {
20036 let val = buf.get_u8();
20037 *v = val;
20038 }
20039 Ok(__struct)
20040 }
20041 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20042 let mut __tmp = BytesMut::new(bytes);
20043 #[allow(clippy::absurd_extreme_comparisons)]
20044 #[allow(unused_comparisons)]
20045 if __tmp.remaining() < Self::ENCODED_LEN {
20046 panic!(
20047 "buffer is too small (need {} bytes, but got {})",
20048 Self::ENCODED_LEN,
20049 __tmp.remaining(),
20050 )
20051 }
20052 __tmp.put_u32_le(self.time_boot_ms);
20053 __tmp.put_f32_le(self.value);
20054 for val in &self.name {
20055 __tmp.put_u8(*val);
20056 }
20057 if matches!(version, MavlinkVersion::V2) {
20058 let len = __tmp.len();
20059 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20060 } else {
20061 __tmp.len()
20062 }
20063 }
20064}
20065#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20066#[doc = ""]
20067#[doc = "ID: 252"]
20068#[derive(Debug, Clone, PartialEq)]
20069#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20071pub struct NAMED_VALUE_INT_DATA {
20072 #[doc = "Timestamp (time since system boot)."]
20073 pub time_boot_ms: u32,
20074 #[doc = "Signed integer value"]
20075 pub value: i32,
20076 #[doc = "Name of the debug variable"]
20077 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20078 pub name: [u8; 10],
20079}
20080impl NAMED_VALUE_INT_DATA {
20081 pub const ENCODED_LEN: usize = 18usize;
20082 pub const DEFAULT: Self = Self {
20083 time_boot_ms: 0_u32,
20084 value: 0_i32,
20085 name: [0_u8; 10usize],
20086 };
20087 #[cfg(feature = "arbitrary")]
20088 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20089 use arbitrary::{Arbitrary, Unstructured};
20090 let mut buf = [0u8; 1024];
20091 rng.fill_bytes(&mut buf);
20092 let mut unstructured = Unstructured::new(&buf);
20093 Self::arbitrary(&mut unstructured).unwrap_or_default()
20094 }
20095}
20096impl Default for NAMED_VALUE_INT_DATA {
20097 fn default() -> Self {
20098 Self::DEFAULT.clone()
20099 }
20100}
20101impl MessageData for NAMED_VALUE_INT_DATA {
20102 type Message = MavMessage;
20103 const ID: u32 = 252u32;
20104 const NAME: &'static str = "NAMED_VALUE_INT";
20105 const EXTRA_CRC: u8 = 44u8;
20106 const ENCODED_LEN: usize = 18usize;
20107 fn deser(
20108 _version: MavlinkVersion,
20109 __input: &[u8],
20110 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20111 let avail_len = __input.len();
20112 let mut payload_buf = [0; Self::ENCODED_LEN];
20113 let mut buf = if avail_len < Self::ENCODED_LEN {
20114 payload_buf[0..avail_len].copy_from_slice(__input);
20115 Bytes::new(&payload_buf)
20116 } else {
20117 Bytes::new(__input)
20118 };
20119 let mut __struct = Self::default();
20120 __struct.time_boot_ms = buf.get_u32_le();
20121 __struct.value = buf.get_i32_le();
20122 for v in &mut __struct.name {
20123 let val = buf.get_u8();
20124 *v = val;
20125 }
20126 Ok(__struct)
20127 }
20128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20129 let mut __tmp = BytesMut::new(bytes);
20130 #[allow(clippy::absurd_extreme_comparisons)]
20131 #[allow(unused_comparisons)]
20132 if __tmp.remaining() < Self::ENCODED_LEN {
20133 panic!(
20134 "buffer is too small (need {} bytes, but got {})",
20135 Self::ENCODED_LEN,
20136 __tmp.remaining(),
20137 )
20138 }
20139 __tmp.put_u32_le(self.time_boot_ms);
20140 __tmp.put_i32_le(self.value);
20141 for val in &self.name {
20142 __tmp.put_u8(*val);
20143 }
20144 if matches!(version, MavlinkVersion::V2) {
20145 let len = __tmp.len();
20146 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20147 } else {
20148 __tmp.len()
20149 }
20150 }
20151}
20152#[doc = "The state of the navigation and position controller."]
20153#[doc = ""]
20154#[doc = "ID: 62"]
20155#[derive(Debug, Clone, PartialEq)]
20156#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20157#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20158pub struct NAV_CONTROLLER_OUTPUT_DATA {
20159 #[doc = "Current desired roll"]
20160 pub nav_roll: f32,
20161 #[doc = "Current desired pitch"]
20162 pub nav_pitch: f32,
20163 #[doc = "Current altitude error"]
20164 pub alt_error: f32,
20165 #[doc = "Current airspeed error"]
20166 pub aspd_error: f32,
20167 #[doc = "Current crosstrack error on x-y plane"]
20168 pub xtrack_error: f32,
20169 #[doc = "Current desired heading"]
20170 pub nav_bearing: i16,
20171 #[doc = "Bearing to current waypoint/target"]
20172 pub target_bearing: i16,
20173 #[doc = "Distance to active waypoint"]
20174 pub wp_dist: u16,
20175}
20176impl NAV_CONTROLLER_OUTPUT_DATA {
20177 pub const ENCODED_LEN: usize = 26usize;
20178 pub const DEFAULT: Self = Self {
20179 nav_roll: 0.0_f32,
20180 nav_pitch: 0.0_f32,
20181 alt_error: 0.0_f32,
20182 aspd_error: 0.0_f32,
20183 xtrack_error: 0.0_f32,
20184 nav_bearing: 0_i16,
20185 target_bearing: 0_i16,
20186 wp_dist: 0_u16,
20187 };
20188 #[cfg(feature = "arbitrary")]
20189 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20190 use arbitrary::{Arbitrary, Unstructured};
20191 let mut buf = [0u8; 1024];
20192 rng.fill_bytes(&mut buf);
20193 let mut unstructured = Unstructured::new(&buf);
20194 Self::arbitrary(&mut unstructured).unwrap_or_default()
20195 }
20196}
20197impl Default for NAV_CONTROLLER_OUTPUT_DATA {
20198 fn default() -> Self {
20199 Self::DEFAULT.clone()
20200 }
20201}
20202impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
20203 type Message = MavMessage;
20204 const ID: u32 = 62u32;
20205 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
20206 const EXTRA_CRC: u8 = 183u8;
20207 const ENCODED_LEN: usize = 26usize;
20208 fn deser(
20209 _version: MavlinkVersion,
20210 __input: &[u8],
20211 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20212 let avail_len = __input.len();
20213 let mut payload_buf = [0; Self::ENCODED_LEN];
20214 let mut buf = if avail_len < Self::ENCODED_LEN {
20215 payload_buf[0..avail_len].copy_from_slice(__input);
20216 Bytes::new(&payload_buf)
20217 } else {
20218 Bytes::new(__input)
20219 };
20220 let mut __struct = Self::default();
20221 __struct.nav_roll = buf.get_f32_le();
20222 __struct.nav_pitch = buf.get_f32_le();
20223 __struct.alt_error = buf.get_f32_le();
20224 __struct.aspd_error = buf.get_f32_le();
20225 __struct.xtrack_error = buf.get_f32_le();
20226 __struct.nav_bearing = buf.get_i16_le();
20227 __struct.target_bearing = buf.get_i16_le();
20228 __struct.wp_dist = buf.get_u16_le();
20229 Ok(__struct)
20230 }
20231 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20232 let mut __tmp = BytesMut::new(bytes);
20233 #[allow(clippy::absurd_extreme_comparisons)]
20234 #[allow(unused_comparisons)]
20235 if __tmp.remaining() < Self::ENCODED_LEN {
20236 panic!(
20237 "buffer is too small (need {} bytes, but got {})",
20238 Self::ENCODED_LEN,
20239 __tmp.remaining(),
20240 )
20241 }
20242 __tmp.put_f32_le(self.nav_roll);
20243 __tmp.put_f32_le(self.nav_pitch);
20244 __tmp.put_f32_le(self.alt_error);
20245 __tmp.put_f32_le(self.aspd_error);
20246 __tmp.put_f32_le(self.xtrack_error);
20247 __tmp.put_i16_le(self.nav_bearing);
20248 __tmp.put_i16_le(self.target_bearing);
20249 __tmp.put_u16_le(self.wp_dist);
20250 if matches!(version, MavlinkVersion::V2) {
20251 let len = __tmp.len();
20252 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20253 } else {
20254 __tmp.len()
20255 }
20256 }
20257}
20258#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
20259#[doc = ""]
20260#[doc = "ID: 330"]
20261#[derive(Debug, Clone, PartialEq)]
20262#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20263#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20264pub struct OBSTACLE_DISTANCE_DATA {
20265 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20266 pub time_usec: u64,
20267 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
20268 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20269 pub distances: [u16; 72],
20270 #[doc = "Minimum distance the sensor can measure."]
20271 pub min_distance: u16,
20272 #[doc = "Maximum distance the sensor can measure."]
20273 pub max_distance: u16,
20274 #[doc = "Class id of the distance sensor type."]
20275 pub sensor_type: MavDistanceSensor,
20276 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
20277 pub increment: u8,
20278 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
20279 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20280 pub increment_f: f32,
20281 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
20282 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20283 pub angle_offset: f32,
20284 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
20285 #[cfg_attr(feature = "serde", serde(default))]
20286 pub frame: MavFrame,
20287}
20288impl OBSTACLE_DISTANCE_DATA {
20289 pub const ENCODED_LEN: usize = 167usize;
20290 pub const DEFAULT: Self = Self {
20291 time_usec: 0_u64,
20292 distances: [0_u16; 72usize],
20293 min_distance: 0_u16,
20294 max_distance: 0_u16,
20295 sensor_type: MavDistanceSensor::DEFAULT,
20296 increment: 0_u8,
20297 increment_f: 0.0_f32,
20298 angle_offset: 0.0_f32,
20299 frame: MavFrame::DEFAULT,
20300 };
20301 #[cfg(feature = "arbitrary")]
20302 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20303 use arbitrary::{Arbitrary, Unstructured};
20304 let mut buf = [0u8; 1024];
20305 rng.fill_bytes(&mut buf);
20306 let mut unstructured = Unstructured::new(&buf);
20307 Self::arbitrary(&mut unstructured).unwrap_or_default()
20308 }
20309}
20310impl Default for OBSTACLE_DISTANCE_DATA {
20311 fn default() -> Self {
20312 Self::DEFAULT.clone()
20313 }
20314}
20315impl MessageData for OBSTACLE_DISTANCE_DATA {
20316 type Message = MavMessage;
20317 const ID: u32 = 330u32;
20318 const NAME: &'static str = "OBSTACLE_DISTANCE";
20319 const EXTRA_CRC: u8 = 23u8;
20320 const ENCODED_LEN: usize = 167usize;
20321 fn deser(
20322 _version: MavlinkVersion,
20323 __input: &[u8],
20324 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20325 let avail_len = __input.len();
20326 let mut payload_buf = [0; Self::ENCODED_LEN];
20327 let mut buf = if avail_len < Self::ENCODED_LEN {
20328 payload_buf[0..avail_len].copy_from_slice(__input);
20329 Bytes::new(&payload_buf)
20330 } else {
20331 Bytes::new(__input)
20332 };
20333 let mut __struct = Self::default();
20334 __struct.time_usec = buf.get_u64_le();
20335 for v in &mut __struct.distances {
20336 let val = buf.get_u16_le();
20337 *v = val;
20338 }
20339 __struct.min_distance = buf.get_u16_le();
20340 __struct.max_distance = buf.get_u16_le();
20341 let tmp = buf.get_u8();
20342 __struct.sensor_type =
20343 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20344 enum_type: "MavDistanceSensor",
20345 value: tmp as u32,
20346 })?;
20347 __struct.increment = buf.get_u8();
20348 __struct.increment_f = buf.get_f32_le();
20349 __struct.angle_offset = buf.get_f32_le();
20350 let tmp = buf.get_u8();
20351 __struct.frame =
20352 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20353 enum_type: "MavFrame",
20354 value: tmp as u32,
20355 })?;
20356 Ok(__struct)
20357 }
20358 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20359 let mut __tmp = BytesMut::new(bytes);
20360 #[allow(clippy::absurd_extreme_comparisons)]
20361 #[allow(unused_comparisons)]
20362 if __tmp.remaining() < Self::ENCODED_LEN {
20363 panic!(
20364 "buffer is too small (need {} bytes, but got {})",
20365 Self::ENCODED_LEN,
20366 __tmp.remaining(),
20367 )
20368 }
20369 __tmp.put_u64_le(self.time_usec);
20370 for val in &self.distances {
20371 __tmp.put_u16_le(*val);
20372 }
20373 __tmp.put_u16_le(self.min_distance);
20374 __tmp.put_u16_le(self.max_distance);
20375 __tmp.put_u8(self.sensor_type as u8);
20376 __tmp.put_u8(self.increment);
20377 if matches!(version, MavlinkVersion::V2) {
20378 __tmp.put_f32_le(self.increment_f);
20379 __tmp.put_f32_le(self.angle_offset);
20380 __tmp.put_u8(self.frame as u8);
20381 let len = __tmp.len();
20382 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20383 } else {
20384 __tmp.len()
20385 }
20386 }
20387}
20388#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
20389#[doc = ""]
20390#[doc = "ID: 331"]
20391#[derive(Debug, Clone, PartialEq)]
20392#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20394pub struct ODOMETRY_DATA {
20395 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20396 pub time_usec: u64,
20397 #[doc = "X Position"]
20398 pub x: f32,
20399 #[doc = "Y Position"]
20400 pub y: f32,
20401 #[doc = "Z Position"]
20402 pub z: f32,
20403 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
20404 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20405 pub q: [f32; 4],
20406 #[doc = "X linear speed"]
20407 pub vx: f32,
20408 #[doc = "Y linear speed"]
20409 pub vy: f32,
20410 #[doc = "Z linear speed"]
20411 pub vz: f32,
20412 #[doc = "Roll angular speed"]
20413 pub rollspeed: f32,
20414 #[doc = "Pitch angular speed"]
20415 pub pitchspeed: f32,
20416 #[doc = "Yaw angular speed"]
20417 pub yawspeed: f32,
20418 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20419 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20420 pub pose_covariance: [f32; 21],
20421 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20422 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20423 pub velocity_covariance: [f32; 21],
20424 #[doc = "Coordinate frame of reference for the pose data."]
20425 pub frame_id: MavFrame,
20426 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
20427 pub child_frame_id: MavFrame,
20428 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
20429 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20430 pub reset_counter: u8,
20431 #[doc = "Type of estimator that is providing the odometry."]
20432 #[cfg_attr(feature = "serde", serde(default))]
20433 pub estimator_type: MavEstimatorType,
20434 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
20435 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20436 pub quality: i8,
20437}
20438impl ODOMETRY_DATA {
20439 pub const ENCODED_LEN: usize = 233usize;
20440 pub const DEFAULT: Self = Self {
20441 time_usec: 0_u64,
20442 x: 0.0_f32,
20443 y: 0.0_f32,
20444 z: 0.0_f32,
20445 q: [0.0_f32; 4usize],
20446 vx: 0.0_f32,
20447 vy: 0.0_f32,
20448 vz: 0.0_f32,
20449 rollspeed: 0.0_f32,
20450 pitchspeed: 0.0_f32,
20451 yawspeed: 0.0_f32,
20452 pose_covariance: [0.0_f32; 21usize],
20453 velocity_covariance: [0.0_f32; 21usize],
20454 frame_id: MavFrame::DEFAULT,
20455 child_frame_id: MavFrame::DEFAULT,
20456 reset_counter: 0_u8,
20457 estimator_type: MavEstimatorType::DEFAULT,
20458 quality: 0_i8,
20459 };
20460 #[cfg(feature = "arbitrary")]
20461 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20462 use arbitrary::{Arbitrary, Unstructured};
20463 let mut buf = [0u8; 1024];
20464 rng.fill_bytes(&mut buf);
20465 let mut unstructured = Unstructured::new(&buf);
20466 Self::arbitrary(&mut unstructured).unwrap_or_default()
20467 }
20468}
20469impl Default for ODOMETRY_DATA {
20470 fn default() -> Self {
20471 Self::DEFAULT.clone()
20472 }
20473}
20474impl MessageData for ODOMETRY_DATA {
20475 type Message = MavMessage;
20476 const ID: u32 = 331u32;
20477 const NAME: &'static str = "ODOMETRY";
20478 const EXTRA_CRC: u8 = 91u8;
20479 const ENCODED_LEN: usize = 233usize;
20480 fn deser(
20481 _version: MavlinkVersion,
20482 __input: &[u8],
20483 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20484 let avail_len = __input.len();
20485 let mut payload_buf = [0; Self::ENCODED_LEN];
20486 let mut buf = if avail_len < Self::ENCODED_LEN {
20487 payload_buf[0..avail_len].copy_from_slice(__input);
20488 Bytes::new(&payload_buf)
20489 } else {
20490 Bytes::new(__input)
20491 };
20492 let mut __struct = Self::default();
20493 __struct.time_usec = buf.get_u64_le();
20494 __struct.x = buf.get_f32_le();
20495 __struct.y = buf.get_f32_le();
20496 __struct.z = buf.get_f32_le();
20497 for v in &mut __struct.q {
20498 let val = buf.get_f32_le();
20499 *v = val;
20500 }
20501 __struct.vx = buf.get_f32_le();
20502 __struct.vy = buf.get_f32_le();
20503 __struct.vz = buf.get_f32_le();
20504 __struct.rollspeed = buf.get_f32_le();
20505 __struct.pitchspeed = buf.get_f32_le();
20506 __struct.yawspeed = buf.get_f32_le();
20507 for v in &mut __struct.pose_covariance {
20508 let val = buf.get_f32_le();
20509 *v = val;
20510 }
20511 for v in &mut __struct.velocity_covariance {
20512 let val = buf.get_f32_le();
20513 *v = val;
20514 }
20515 let tmp = buf.get_u8();
20516 __struct.frame_id =
20517 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20518 enum_type: "MavFrame",
20519 value: tmp as u32,
20520 })?;
20521 let tmp = buf.get_u8();
20522 __struct.child_frame_id =
20523 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20524 enum_type: "MavFrame",
20525 value: tmp as u32,
20526 })?;
20527 __struct.reset_counter = buf.get_u8();
20528 let tmp = buf.get_u8();
20529 __struct.estimator_type =
20530 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20531 enum_type: "MavEstimatorType",
20532 value: tmp as u32,
20533 })?;
20534 __struct.quality = buf.get_i8();
20535 Ok(__struct)
20536 }
20537 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20538 let mut __tmp = BytesMut::new(bytes);
20539 #[allow(clippy::absurd_extreme_comparisons)]
20540 #[allow(unused_comparisons)]
20541 if __tmp.remaining() < Self::ENCODED_LEN {
20542 panic!(
20543 "buffer is too small (need {} bytes, but got {})",
20544 Self::ENCODED_LEN,
20545 __tmp.remaining(),
20546 )
20547 }
20548 __tmp.put_u64_le(self.time_usec);
20549 __tmp.put_f32_le(self.x);
20550 __tmp.put_f32_le(self.y);
20551 __tmp.put_f32_le(self.z);
20552 for val in &self.q {
20553 __tmp.put_f32_le(*val);
20554 }
20555 __tmp.put_f32_le(self.vx);
20556 __tmp.put_f32_le(self.vy);
20557 __tmp.put_f32_le(self.vz);
20558 __tmp.put_f32_le(self.rollspeed);
20559 __tmp.put_f32_le(self.pitchspeed);
20560 __tmp.put_f32_le(self.yawspeed);
20561 for val in &self.pose_covariance {
20562 __tmp.put_f32_le(*val);
20563 }
20564 for val in &self.velocity_covariance {
20565 __tmp.put_f32_le(*val);
20566 }
20567 __tmp.put_u8(self.frame_id as u8);
20568 __tmp.put_u8(self.child_frame_id as u8);
20569 if matches!(version, MavlinkVersion::V2) {
20570 __tmp.put_u8(self.reset_counter);
20571 __tmp.put_u8(self.estimator_type as u8);
20572 __tmp.put_i8(self.quality);
20573 let len = __tmp.len();
20574 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20575 } else {
20576 __tmp.len()
20577 }
20578 }
20579}
20580#[doc = "Hardware status sent by an onboard computer."]
20581#[doc = ""]
20582#[doc = "ID: 390"]
20583#[derive(Debug, Clone, PartialEq)]
20584#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20585#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20586pub struct ONBOARD_COMPUTER_STATUS_DATA {
20587 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20588 pub time_usec: u64,
20589 #[doc = "Time since system boot."]
20590 pub uptime: u32,
20591 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
20592 pub ram_usage: u32,
20593 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
20594 pub ram_total: u32,
20595 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
20596 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20597 pub storage_type: [u32; 4],
20598 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
20599 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20600 pub storage_usage: [u32; 4],
20601 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
20602 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20603 pub storage_total: [u32; 4],
20604 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
20605 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20606 pub link_type: [u32; 6],
20607 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
20608 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20609 pub link_tx_rate: [u32; 6],
20610 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
20611 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20612 pub link_rx_rate: [u32; 6],
20613 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
20614 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20615 pub link_tx_max: [u32; 6],
20616 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
20617 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20618 pub link_rx_max: [u32; 6],
20619 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
20620 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20621 pub fan_speed: [i16; 4],
20622 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
20623 pub mavtype: u8,
20624 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
20625 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20626 pub cpu_cores: [u8; 8],
20627 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
20628 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20629 pub cpu_combined: [u8; 10],
20630 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
20631 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20632 pub gpu_cores: [u8; 4],
20633 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
20634 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20635 pub gpu_combined: [u8; 10],
20636 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
20637 pub temperature_board: i8,
20638 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
20639 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20640 pub temperature_core: [i8; 8],
20641}
20642impl ONBOARD_COMPUTER_STATUS_DATA {
20643 pub const ENCODED_LEN: usize = 238usize;
20644 pub const DEFAULT: Self = Self {
20645 time_usec: 0_u64,
20646 uptime: 0_u32,
20647 ram_usage: 0_u32,
20648 ram_total: 0_u32,
20649 storage_type: [0_u32; 4usize],
20650 storage_usage: [0_u32; 4usize],
20651 storage_total: [0_u32; 4usize],
20652 link_type: [0_u32; 6usize],
20653 link_tx_rate: [0_u32; 6usize],
20654 link_rx_rate: [0_u32; 6usize],
20655 link_tx_max: [0_u32; 6usize],
20656 link_rx_max: [0_u32; 6usize],
20657 fan_speed: [0_i16; 4usize],
20658 mavtype: 0_u8,
20659 cpu_cores: [0_u8; 8usize],
20660 cpu_combined: [0_u8; 10usize],
20661 gpu_cores: [0_u8; 4usize],
20662 gpu_combined: [0_u8; 10usize],
20663 temperature_board: 0_i8,
20664 temperature_core: [0_i8; 8usize],
20665 };
20666 #[cfg(feature = "arbitrary")]
20667 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20668 use arbitrary::{Arbitrary, Unstructured};
20669 let mut buf = [0u8; 1024];
20670 rng.fill_bytes(&mut buf);
20671 let mut unstructured = Unstructured::new(&buf);
20672 Self::arbitrary(&mut unstructured).unwrap_or_default()
20673 }
20674}
20675impl Default for ONBOARD_COMPUTER_STATUS_DATA {
20676 fn default() -> Self {
20677 Self::DEFAULT.clone()
20678 }
20679}
20680impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
20681 type Message = MavMessage;
20682 const ID: u32 = 390u32;
20683 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
20684 const EXTRA_CRC: u8 = 156u8;
20685 const ENCODED_LEN: usize = 238usize;
20686 fn deser(
20687 _version: MavlinkVersion,
20688 __input: &[u8],
20689 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20690 let avail_len = __input.len();
20691 let mut payload_buf = [0; Self::ENCODED_LEN];
20692 let mut buf = if avail_len < Self::ENCODED_LEN {
20693 payload_buf[0..avail_len].copy_from_slice(__input);
20694 Bytes::new(&payload_buf)
20695 } else {
20696 Bytes::new(__input)
20697 };
20698 let mut __struct = Self::default();
20699 __struct.time_usec = buf.get_u64_le();
20700 __struct.uptime = buf.get_u32_le();
20701 __struct.ram_usage = buf.get_u32_le();
20702 __struct.ram_total = buf.get_u32_le();
20703 for v in &mut __struct.storage_type {
20704 let val = buf.get_u32_le();
20705 *v = val;
20706 }
20707 for v in &mut __struct.storage_usage {
20708 let val = buf.get_u32_le();
20709 *v = val;
20710 }
20711 for v in &mut __struct.storage_total {
20712 let val = buf.get_u32_le();
20713 *v = val;
20714 }
20715 for v in &mut __struct.link_type {
20716 let val = buf.get_u32_le();
20717 *v = val;
20718 }
20719 for v in &mut __struct.link_tx_rate {
20720 let val = buf.get_u32_le();
20721 *v = val;
20722 }
20723 for v in &mut __struct.link_rx_rate {
20724 let val = buf.get_u32_le();
20725 *v = val;
20726 }
20727 for v in &mut __struct.link_tx_max {
20728 let val = buf.get_u32_le();
20729 *v = val;
20730 }
20731 for v in &mut __struct.link_rx_max {
20732 let val = buf.get_u32_le();
20733 *v = val;
20734 }
20735 for v in &mut __struct.fan_speed {
20736 let val = buf.get_i16_le();
20737 *v = val;
20738 }
20739 __struct.mavtype = buf.get_u8();
20740 for v in &mut __struct.cpu_cores {
20741 let val = buf.get_u8();
20742 *v = val;
20743 }
20744 for v in &mut __struct.cpu_combined {
20745 let val = buf.get_u8();
20746 *v = val;
20747 }
20748 for v in &mut __struct.gpu_cores {
20749 let val = buf.get_u8();
20750 *v = val;
20751 }
20752 for v in &mut __struct.gpu_combined {
20753 let val = buf.get_u8();
20754 *v = val;
20755 }
20756 __struct.temperature_board = buf.get_i8();
20757 for v in &mut __struct.temperature_core {
20758 let val = buf.get_i8();
20759 *v = val;
20760 }
20761 Ok(__struct)
20762 }
20763 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20764 let mut __tmp = BytesMut::new(bytes);
20765 #[allow(clippy::absurd_extreme_comparisons)]
20766 #[allow(unused_comparisons)]
20767 if __tmp.remaining() < Self::ENCODED_LEN {
20768 panic!(
20769 "buffer is too small (need {} bytes, but got {})",
20770 Self::ENCODED_LEN,
20771 __tmp.remaining(),
20772 )
20773 }
20774 __tmp.put_u64_le(self.time_usec);
20775 __tmp.put_u32_le(self.uptime);
20776 __tmp.put_u32_le(self.ram_usage);
20777 __tmp.put_u32_le(self.ram_total);
20778 for val in &self.storage_type {
20779 __tmp.put_u32_le(*val);
20780 }
20781 for val in &self.storage_usage {
20782 __tmp.put_u32_le(*val);
20783 }
20784 for val in &self.storage_total {
20785 __tmp.put_u32_le(*val);
20786 }
20787 for val in &self.link_type {
20788 __tmp.put_u32_le(*val);
20789 }
20790 for val in &self.link_tx_rate {
20791 __tmp.put_u32_le(*val);
20792 }
20793 for val in &self.link_rx_rate {
20794 __tmp.put_u32_le(*val);
20795 }
20796 for val in &self.link_tx_max {
20797 __tmp.put_u32_le(*val);
20798 }
20799 for val in &self.link_rx_max {
20800 __tmp.put_u32_le(*val);
20801 }
20802 for val in &self.fan_speed {
20803 __tmp.put_i16_le(*val);
20804 }
20805 __tmp.put_u8(self.mavtype);
20806 for val in &self.cpu_cores {
20807 __tmp.put_u8(*val);
20808 }
20809 for val in &self.cpu_combined {
20810 __tmp.put_u8(*val);
20811 }
20812 for val in &self.gpu_cores {
20813 __tmp.put_u8(*val);
20814 }
20815 for val in &self.gpu_combined {
20816 __tmp.put_u8(*val);
20817 }
20818 __tmp.put_i8(self.temperature_board);
20819 for val in &self.temperature_core {
20820 __tmp.put_i8(*val);
20821 }
20822 if matches!(version, MavlinkVersion::V2) {
20823 let len = __tmp.len();
20824 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20825 } else {
20826 __tmp.len()
20827 }
20828 }
20829}
20830#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
20831#[doc = ""]
20832#[doc = "ID: 12918"]
20833#[derive(Debug, Clone, PartialEq)]
20834#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20835#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20836pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
20837 #[doc = "Status level indicating if arming is allowed."]
20838 pub status: MavOdidArmStatus,
20839 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
20840 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20841 pub error: [u8; 50],
20842}
20843impl OPEN_DRONE_ID_ARM_STATUS_DATA {
20844 pub const ENCODED_LEN: usize = 51usize;
20845 pub const DEFAULT: Self = Self {
20846 status: MavOdidArmStatus::DEFAULT,
20847 error: [0_u8; 50usize],
20848 };
20849 #[cfg(feature = "arbitrary")]
20850 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20851 use arbitrary::{Arbitrary, Unstructured};
20852 let mut buf = [0u8; 1024];
20853 rng.fill_bytes(&mut buf);
20854 let mut unstructured = Unstructured::new(&buf);
20855 Self::arbitrary(&mut unstructured).unwrap_or_default()
20856 }
20857}
20858impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
20859 fn default() -> Self {
20860 Self::DEFAULT.clone()
20861 }
20862}
20863impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
20864 type Message = MavMessage;
20865 const ID: u32 = 12918u32;
20866 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
20867 const EXTRA_CRC: u8 = 139u8;
20868 const ENCODED_LEN: usize = 51usize;
20869 fn deser(
20870 _version: MavlinkVersion,
20871 __input: &[u8],
20872 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20873 let avail_len = __input.len();
20874 let mut payload_buf = [0; Self::ENCODED_LEN];
20875 let mut buf = if avail_len < Self::ENCODED_LEN {
20876 payload_buf[0..avail_len].copy_from_slice(__input);
20877 Bytes::new(&payload_buf)
20878 } else {
20879 Bytes::new(__input)
20880 };
20881 let mut __struct = Self::default();
20882 let tmp = buf.get_u8();
20883 __struct.status =
20884 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20885 enum_type: "MavOdidArmStatus",
20886 value: tmp as u32,
20887 })?;
20888 for v in &mut __struct.error {
20889 let val = buf.get_u8();
20890 *v = val;
20891 }
20892 Ok(__struct)
20893 }
20894 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20895 let mut __tmp = BytesMut::new(bytes);
20896 #[allow(clippy::absurd_extreme_comparisons)]
20897 #[allow(unused_comparisons)]
20898 if __tmp.remaining() < Self::ENCODED_LEN {
20899 panic!(
20900 "buffer is too small (need {} bytes, but got {})",
20901 Self::ENCODED_LEN,
20902 __tmp.remaining(),
20903 )
20904 }
20905 __tmp.put_u8(self.status as u8);
20906 for val in &self.error {
20907 __tmp.put_u8(*val);
20908 }
20909 if matches!(version, MavlinkVersion::V2) {
20910 let len = __tmp.len();
20911 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20912 } else {
20913 __tmp.len()
20914 }
20915 }
20916}
20917#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
20918#[doc = ""]
20919#[doc = "ID: 12902"]
20920#[derive(Debug, Clone, PartialEq)]
20921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20923pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
20924 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
20925 pub timestamp: u32,
20926 #[doc = "System ID (0 for broadcast)."]
20927 pub target_system: u8,
20928 #[doc = "Component ID (0 for broadcast)."]
20929 pub target_component: u8,
20930 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
20931 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20932 pub id_or_mac: [u8; 20],
20933 #[doc = "Indicates the type of authentication."]
20934 pub authentication_type: MavOdidAuthType,
20935 #[doc = "Allowed range is 0 - 15."]
20936 pub data_page: u8,
20937 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
20938 pub last_page_index: u8,
20939 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
20940 pub length: u8,
20941 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
20942 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20943 pub authentication_data: [u8; 23],
20944}
20945impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
20946 pub const ENCODED_LEN: usize = 53usize;
20947 pub const DEFAULT: Self = Self {
20948 timestamp: 0_u32,
20949 target_system: 0_u8,
20950 target_component: 0_u8,
20951 id_or_mac: [0_u8; 20usize],
20952 authentication_type: MavOdidAuthType::DEFAULT,
20953 data_page: 0_u8,
20954 last_page_index: 0_u8,
20955 length: 0_u8,
20956 authentication_data: [0_u8; 23usize],
20957 };
20958 #[cfg(feature = "arbitrary")]
20959 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20960 use arbitrary::{Arbitrary, Unstructured};
20961 let mut buf = [0u8; 1024];
20962 rng.fill_bytes(&mut buf);
20963 let mut unstructured = Unstructured::new(&buf);
20964 Self::arbitrary(&mut unstructured).unwrap_or_default()
20965 }
20966}
20967impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
20968 fn default() -> Self {
20969 Self::DEFAULT.clone()
20970 }
20971}
20972impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
20973 type Message = MavMessage;
20974 const ID: u32 = 12902u32;
20975 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
20976 const EXTRA_CRC: u8 = 140u8;
20977 const ENCODED_LEN: usize = 53usize;
20978 fn deser(
20979 _version: MavlinkVersion,
20980 __input: &[u8],
20981 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20982 let avail_len = __input.len();
20983 let mut payload_buf = [0; Self::ENCODED_LEN];
20984 let mut buf = if avail_len < Self::ENCODED_LEN {
20985 payload_buf[0..avail_len].copy_from_slice(__input);
20986 Bytes::new(&payload_buf)
20987 } else {
20988 Bytes::new(__input)
20989 };
20990 let mut __struct = Self::default();
20991 __struct.timestamp = buf.get_u32_le();
20992 __struct.target_system = buf.get_u8();
20993 __struct.target_component = buf.get_u8();
20994 for v in &mut __struct.id_or_mac {
20995 let val = buf.get_u8();
20996 *v = val;
20997 }
20998 let tmp = buf.get_u8();
20999 __struct.authentication_type =
21000 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21001 enum_type: "MavOdidAuthType",
21002 value: tmp as u32,
21003 })?;
21004 __struct.data_page = buf.get_u8();
21005 __struct.last_page_index = buf.get_u8();
21006 __struct.length = buf.get_u8();
21007 for v in &mut __struct.authentication_data {
21008 let val = buf.get_u8();
21009 *v = val;
21010 }
21011 Ok(__struct)
21012 }
21013 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21014 let mut __tmp = BytesMut::new(bytes);
21015 #[allow(clippy::absurd_extreme_comparisons)]
21016 #[allow(unused_comparisons)]
21017 if __tmp.remaining() < Self::ENCODED_LEN {
21018 panic!(
21019 "buffer is too small (need {} bytes, but got {})",
21020 Self::ENCODED_LEN,
21021 __tmp.remaining(),
21022 )
21023 }
21024 __tmp.put_u32_le(self.timestamp);
21025 __tmp.put_u8(self.target_system);
21026 __tmp.put_u8(self.target_component);
21027 for val in &self.id_or_mac {
21028 __tmp.put_u8(*val);
21029 }
21030 __tmp.put_u8(self.authentication_type as u8);
21031 __tmp.put_u8(self.data_page);
21032 __tmp.put_u8(self.last_page_index);
21033 __tmp.put_u8(self.length);
21034 for val in &self.authentication_data {
21035 __tmp.put_u8(*val);
21036 }
21037 if matches!(version, MavlinkVersion::V2) {
21038 let len = __tmp.len();
21039 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21040 } else {
21041 __tmp.len()
21042 }
21043 }
21044}
21045#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
21046#[doc = ""]
21047#[doc = "ID: 12900"]
21048#[derive(Debug, Clone, PartialEq)]
21049#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21050#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21051pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
21052 #[doc = "System ID (0 for broadcast)."]
21053 pub target_system: u8,
21054 #[doc = "Component ID (0 for broadcast)."]
21055 pub target_component: u8,
21056 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21057 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21058 pub id_or_mac: [u8; 20],
21059 #[doc = "Indicates the format for the uas_id field of this message."]
21060 pub id_type: MavOdidIdType,
21061 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
21062 pub ua_type: MavOdidUaType,
21063 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
21064 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21065 pub uas_id: [u8; 20],
21066}
21067impl OPEN_DRONE_ID_BASIC_ID_DATA {
21068 pub const ENCODED_LEN: usize = 44usize;
21069 pub const DEFAULT: Self = Self {
21070 target_system: 0_u8,
21071 target_component: 0_u8,
21072 id_or_mac: [0_u8; 20usize],
21073 id_type: MavOdidIdType::DEFAULT,
21074 ua_type: MavOdidUaType::DEFAULT,
21075 uas_id: [0_u8; 20usize],
21076 };
21077 #[cfg(feature = "arbitrary")]
21078 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21079 use arbitrary::{Arbitrary, Unstructured};
21080 let mut buf = [0u8; 1024];
21081 rng.fill_bytes(&mut buf);
21082 let mut unstructured = Unstructured::new(&buf);
21083 Self::arbitrary(&mut unstructured).unwrap_or_default()
21084 }
21085}
21086impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
21087 fn default() -> Self {
21088 Self::DEFAULT.clone()
21089 }
21090}
21091impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
21092 type Message = MavMessage;
21093 const ID: u32 = 12900u32;
21094 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
21095 const EXTRA_CRC: u8 = 114u8;
21096 const ENCODED_LEN: usize = 44usize;
21097 fn deser(
21098 _version: MavlinkVersion,
21099 __input: &[u8],
21100 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21101 let avail_len = __input.len();
21102 let mut payload_buf = [0; Self::ENCODED_LEN];
21103 let mut buf = if avail_len < Self::ENCODED_LEN {
21104 payload_buf[0..avail_len].copy_from_slice(__input);
21105 Bytes::new(&payload_buf)
21106 } else {
21107 Bytes::new(__input)
21108 };
21109 let mut __struct = Self::default();
21110 __struct.target_system = buf.get_u8();
21111 __struct.target_component = buf.get_u8();
21112 for v in &mut __struct.id_or_mac {
21113 let val = buf.get_u8();
21114 *v = val;
21115 }
21116 let tmp = buf.get_u8();
21117 __struct.id_type =
21118 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21119 enum_type: "MavOdidIdType",
21120 value: tmp as u32,
21121 })?;
21122 let tmp = buf.get_u8();
21123 __struct.ua_type =
21124 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21125 enum_type: "MavOdidUaType",
21126 value: tmp as u32,
21127 })?;
21128 for v in &mut __struct.uas_id {
21129 let val = buf.get_u8();
21130 *v = val;
21131 }
21132 Ok(__struct)
21133 }
21134 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21135 let mut __tmp = BytesMut::new(bytes);
21136 #[allow(clippy::absurd_extreme_comparisons)]
21137 #[allow(unused_comparisons)]
21138 if __tmp.remaining() < Self::ENCODED_LEN {
21139 panic!(
21140 "buffer is too small (need {} bytes, but got {})",
21141 Self::ENCODED_LEN,
21142 __tmp.remaining(),
21143 )
21144 }
21145 __tmp.put_u8(self.target_system);
21146 __tmp.put_u8(self.target_component);
21147 for val in &self.id_or_mac {
21148 __tmp.put_u8(*val);
21149 }
21150 __tmp.put_u8(self.id_type as u8);
21151 __tmp.put_u8(self.ua_type as u8);
21152 for val in &self.uas_id {
21153 __tmp.put_u8(*val);
21154 }
21155 if matches!(version, MavlinkVersion::V2) {
21156 let len = __tmp.len();
21157 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21158 } else {
21159 __tmp.len()
21160 }
21161 }
21162}
21163#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
21164#[doc = ""]
21165#[doc = "ID: 12901"]
21166#[derive(Debug, Clone, PartialEq)]
21167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21169pub struct OPEN_DRONE_ID_LOCATION_DATA {
21170 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21171 pub latitude: i32,
21172 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21173 pub longitude: i32,
21174 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
21175 pub altitude_barometric: f32,
21176 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
21177 pub altitude_geodetic: f32,
21178 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
21179 pub height: f32,
21180 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
21181 pub timestamp: f32,
21182 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
21183 pub direction: u16,
21184 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
21185 pub speed_horizontal: u16,
21186 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
21187 pub speed_vertical: i16,
21188 #[doc = "System ID (0 for broadcast)."]
21189 pub target_system: u8,
21190 #[doc = "Component ID (0 for broadcast)."]
21191 pub target_component: u8,
21192 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21193 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21194 pub id_or_mac: [u8; 20],
21195 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
21196 pub status: MavOdidStatus,
21197 #[doc = "Indicates the reference point for the height field."]
21198 pub height_reference: MavOdidHeightRef,
21199 #[doc = "The accuracy of the horizontal position."]
21200 pub horizontal_accuracy: MavOdidHorAcc,
21201 #[doc = "The accuracy of the vertical position."]
21202 pub vertical_accuracy: MavOdidVerAcc,
21203 #[doc = "The accuracy of the barometric altitude."]
21204 pub barometer_accuracy: MavOdidVerAcc,
21205 #[doc = "The accuracy of the horizontal and vertical speed."]
21206 pub speed_accuracy: MavOdidSpeedAcc,
21207 #[doc = "The accuracy of the timestamps."]
21208 pub timestamp_accuracy: MavOdidTimeAcc,
21209}
21210impl OPEN_DRONE_ID_LOCATION_DATA {
21211 pub const ENCODED_LEN: usize = 59usize;
21212 pub const DEFAULT: Self = Self {
21213 latitude: 0_i32,
21214 longitude: 0_i32,
21215 altitude_barometric: 0.0_f32,
21216 altitude_geodetic: 0.0_f32,
21217 height: 0.0_f32,
21218 timestamp: 0.0_f32,
21219 direction: 0_u16,
21220 speed_horizontal: 0_u16,
21221 speed_vertical: 0_i16,
21222 target_system: 0_u8,
21223 target_component: 0_u8,
21224 id_or_mac: [0_u8; 20usize],
21225 status: MavOdidStatus::DEFAULT,
21226 height_reference: MavOdidHeightRef::DEFAULT,
21227 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
21228 vertical_accuracy: MavOdidVerAcc::DEFAULT,
21229 barometer_accuracy: MavOdidVerAcc::DEFAULT,
21230 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
21231 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
21232 };
21233 #[cfg(feature = "arbitrary")]
21234 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21235 use arbitrary::{Arbitrary, Unstructured};
21236 let mut buf = [0u8; 1024];
21237 rng.fill_bytes(&mut buf);
21238 let mut unstructured = Unstructured::new(&buf);
21239 Self::arbitrary(&mut unstructured).unwrap_or_default()
21240 }
21241}
21242impl Default for OPEN_DRONE_ID_LOCATION_DATA {
21243 fn default() -> Self {
21244 Self::DEFAULT.clone()
21245 }
21246}
21247impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
21248 type Message = MavMessage;
21249 const ID: u32 = 12901u32;
21250 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
21251 const EXTRA_CRC: u8 = 254u8;
21252 const ENCODED_LEN: usize = 59usize;
21253 fn deser(
21254 _version: MavlinkVersion,
21255 __input: &[u8],
21256 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21257 let avail_len = __input.len();
21258 let mut payload_buf = [0; Self::ENCODED_LEN];
21259 let mut buf = if avail_len < Self::ENCODED_LEN {
21260 payload_buf[0..avail_len].copy_from_slice(__input);
21261 Bytes::new(&payload_buf)
21262 } else {
21263 Bytes::new(__input)
21264 };
21265 let mut __struct = Self::default();
21266 __struct.latitude = buf.get_i32_le();
21267 __struct.longitude = buf.get_i32_le();
21268 __struct.altitude_barometric = buf.get_f32_le();
21269 __struct.altitude_geodetic = buf.get_f32_le();
21270 __struct.height = buf.get_f32_le();
21271 __struct.timestamp = buf.get_f32_le();
21272 __struct.direction = buf.get_u16_le();
21273 __struct.speed_horizontal = buf.get_u16_le();
21274 __struct.speed_vertical = buf.get_i16_le();
21275 __struct.target_system = buf.get_u8();
21276 __struct.target_component = buf.get_u8();
21277 for v in &mut __struct.id_or_mac {
21278 let val = buf.get_u8();
21279 *v = val;
21280 }
21281 let tmp = buf.get_u8();
21282 __struct.status =
21283 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21284 enum_type: "MavOdidStatus",
21285 value: tmp as u32,
21286 })?;
21287 let tmp = buf.get_u8();
21288 __struct.height_reference =
21289 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21290 enum_type: "MavOdidHeightRef",
21291 value: tmp as u32,
21292 })?;
21293 let tmp = buf.get_u8();
21294 __struct.horizontal_accuracy =
21295 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21296 enum_type: "MavOdidHorAcc",
21297 value: tmp as u32,
21298 })?;
21299 let tmp = buf.get_u8();
21300 __struct.vertical_accuracy =
21301 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21302 enum_type: "MavOdidVerAcc",
21303 value: tmp as u32,
21304 })?;
21305 let tmp = buf.get_u8();
21306 __struct.barometer_accuracy =
21307 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21308 enum_type: "MavOdidVerAcc",
21309 value: tmp as u32,
21310 })?;
21311 let tmp = buf.get_u8();
21312 __struct.speed_accuracy =
21313 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21314 enum_type: "MavOdidSpeedAcc",
21315 value: tmp as u32,
21316 })?;
21317 let tmp = buf.get_u8();
21318 __struct.timestamp_accuracy =
21319 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21320 enum_type: "MavOdidTimeAcc",
21321 value: tmp as u32,
21322 })?;
21323 Ok(__struct)
21324 }
21325 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21326 let mut __tmp = BytesMut::new(bytes);
21327 #[allow(clippy::absurd_extreme_comparisons)]
21328 #[allow(unused_comparisons)]
21329 if __tmp.remaining() < Self::ENCODED_LEN {
21330 panic!(
21331 "buffer is too small (need {} bytes, but got {})",
21332 Self::ENCODED_LEN,
21333 __tmp.remaining(),
21334 )
21335 }
21336 __tmp.put_i32_le(self.latitude);
21337 __tmp.put_i32_le(self.longitude);
21338 __tmp.put_f32_le(self.altitude_barometric);
21339 __tmp.put_f32_le(self.altitude_geodetic);
21340 __tmp.put_f32_le(self.height);
21341 __tmp.put_f32_le(self.timestamp);
21342 __tmp.put_u16_le(self.direction);
21343 __tmp.put_u16_le(self.speed_horizontal);
21344 __tmp.put_i16_le(self.speed_vertical);
21345 __tmp.put_u8(self.target_system);
21346 __tmp.put_u8(self.target_component);
21347 for val in &self.id_or_mac {
21348 __tmp.put_u8(*val);
21349 }
21350 __tmp.put_u8(self.status as u8);
21351 __tmp.put_u8(self.height_reference as u8);
21352 __tmp.put_u8(self.horizontal_accuracy as u8);
21353 __tmp.put_u8(self.vertical_accuracy as u8);
21354 __tmp.put_u8(self.barometer_accuracy as u8);
21355 __tmp.put_u8(self.speed_accuracy as u8);
21356 __tmp.put_u8(self.timestamp_accuracy as u8);
21357 if matches!(version, MavlinkVersion::V2) {
21358 let len = __tmp.len();
21359 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21360 } else {
21361 __tmp.len()
21362 }
21363 }
21364}
21365#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
21366#[doc = ""]
21367#[doc = "ID: 12915"]
21368#[derive(Debug, Clone, PartialEq)]
21369#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21370#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21371pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21372 #[doc = "System ID (0 for broadcast)."]
21373 pub target_system: u8,
21374 #[doc = "Component ID (0 for broadcast)."]
21375 pub target_component: u8,
21376 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21377 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21378 pub id_or_mac: [u8; 20],
21379 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
21380 pub single_message_size: u8,
21381 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
21382 pub msg_pack_size: u8,
21383 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
21384 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21385 pub messages: [u8; 225],
21386}
21387impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21388 pub const ENCODED_LEN: usize = 249usize;
21389 pub const DEFAULT: Self = Self {
21390 target_system: 0_u8,
21391 target_component: 0_u8,
21392 id_or_mac: [0_u8; 20usize],
21393 single_message_size: 0_u8,
21394 msg_pack_size: 0_u8,
21395 messages: [0_u8; 225usize],
21396 };
21397 #[cfg(feature = "arbitrary")]
21398 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21399 use arbitrary::{Arbitrary, Unstructured};
21400 let mut buf = [0u8; 1024];
21401 rng.fill_bytes(&mut buf);
21402 let mut unstructured = Unstructured::new(&buf);
21403 Self::arbitrary(&mut unstructured).unwrap_or_default()
21404 }
21405}
21406impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21407 fn default() -> Self {
21408 Self::DEFAULT.clone()
21409 }
21410}
21411impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21412 type Message = MavMessage;
21413 const ID: u32 = 12915u32;
21414 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
21415 const EXTRA_CRC: u8 = 94u8;
21416 const ENCODED_LEN: usize = 249usize;
21417 fn deser(
21418 _version: MavlinkVersion,
21419 __input: &[u8],
21420 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21421 let avail_len = __input.len();
21422 let mut payload_buf = [0; Self::ENCODED_LEN];
21423 let mut buf = if avail_len < Self::ENCODED_LEN {
21424 payload_buf[0..avail_len].copy_from_slice(__input);
21425 Bytes::new(&payload_buf)
21426 } else {
21427 Bytes::new(__input)
21428 };
21429 let mut __struct = Self::default();
21430 __struct.target_system = buf.get_u8();
21431 __struct.target_component = buf.get_u8();
21432 for v in &mut __struct.id_or_mac {
21433 let val = buf.get_u8();
21434 *v = val;
21435 }
21436 __struct.single_message_size = buf.get_u8();
21437 __struct.msg_pack_size = buf.get_u8();
21438 for v in &mut __struct.messages {
21439 let val = buf.get_u8();
21440 *v = val;
21441 }
21442 Ok(__struct)
21443 }
21444 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21445 let mut __tmp = BytesMut::new(bytes);
21446 #[allow(clippy::absurd_extreme_comparisons)]
21447 #[allow(unused_comparisons)]
21448 if __tmp.remaining() < Self::ENCODED_LEN {
21449 panic!(
21450 "buffer is too small (need {} bytes, but got {})",
21451 Self::ENCODED_LEN,
21452 __tmp.remaining(),
21453 )
21454 }
21455 __tmp.put_u8(self.target_system);
21456 __tmp.put_u8(self.target_component);
21457 for val in &self.id_or_mac {
21458 __tmp.put_u8(*val);
21459 }
21460 __tmp.put_u8(self.single_message_size);
21461 __tmp.put_u8(self.msg_pack_size);
21462 for val in &self.messages {
21463 __tmp.put_u8(*val);
21464 }
21465 if matches!(version, MavlinkVersion::V2) {
21466 let len = __tmp.len();
21467 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21468 } else {
21469 __tmp.len()
21470 }
21471 }
21472}
21473#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
21474#[doc = ""]
21475#[doc = "ID: 12905"]
21476#[derive(Debug, Clone, PartialEq)]
21477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21479pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
21480 #[doc = "System ID (0 for broadcast)."]
21481 pub target_system: u8,
21482 #[doc = "Component ID (0 for broadcast)."]
21483 pub target_component: u8,
21484 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21485 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21486 pub id_or_mac: [u8; 20],
21487 #[doc = "Indicates the type of the operator_id field."]
21488 pub operator_id_type: MavOdidOperatorIdType,
21489 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21490 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21491 pub operator_id: [u8; 20],
21492}
21493impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
21494 pub const ENCODED_LEN: usize = 43usize;
21495 pub const DEFAULT: Self = Self {
21496 target_system: 0_u8,
21497 target_component: 0_u8,
21498 id_or_mac: [0_u8; 20usize],
21499 operator_id_type: MavOdidOperatorIdType::DEFAULT,
21500 operator_id: [0_u8; 20usize],
21501 };
21502 #[cfg(feature = "arbitrary")]
21503 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21504 use arbitrary::{Arbitrary, Unstructured};
21505 let mut buf = [0u8; 1024];
21506 rng.fill_bytes(&mut buf);
21507 let mut unstructured = Unstructured::new(&buf);
21508 Self::arbitrary(&mut unstructured).unwrap_or_default()
21509 }
21510}
21511impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21512 fn default() -> Self {
21513 Self::DEFAULT.clone()
21514 }
21515}
21516impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21517 type Message = MavMessage;
21518 const ID: u32 = 12905u32;
21519 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
21520 const EXTRA_CRC: u8 = 49u8;
21521 const ENCODED_LEN: usize = 43usize;
21522 fn deser(
21523 _version: MavlinkVersion,
21524 __input: &[u8],
21525 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21526 let avail_len = __input.len();
21527 let mut payload_buf = [0; Self::ENCODED_LEN];
21528 let mut buf = if avail_len < Self::ENCODED_LEN {
21529 payload_buf[0..avail_len].copy_from_slice(__input);
21530 Bytes::new(&payload_buf)
21531 } else {
21532 Bytes::new(__input)
21533 };
21534 let mut __struct = Self::default();
21535 __struct.target_system = buf.get_u8();
21536 __struct.target_component = buf.get_u8();
21537 for v in &mut __struct.id_or_mac {
21538 let val = buf.get_u8();
21539 *v = val;
21540 }
21541 let tmp = buf.get_u8();
21542 __struct.operator_id_type =
21543 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21544 enum_type: "MavOdidOperatorIdType",
21545 value: tmp as u32,
21546 })?;
21547 for v in &mut __struct.operator_id {
21548 let val = buf.get_u8();
21549 *v = val;
21550 }
21551 Ok(__struct)
21552 }
21553 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21554 let mut __tmp = BytesMut::new(bytes);
21555 #[allow(clippy::absurd_extreme_comparisons)]
21556 #[allow(unused_comparisons)]
21557 if __tmp.remaining() < Self::ENCODED_LEN {
21558 panic!(
21559 "buffer is too small (need {} bytes, but got {})",
21560 Self::ENCODED_LEN,
21561 __tmp.remaining(),
21562 )
21563 }
21564 __tmp.put_u8(self.target_system);
21565 __tmp.put_u8(self.target_component);
21566 for val in &self.id_or_mac {
21567 __tmp.put_u8(*val);
21568 }
21569 __tmp.put_u8(self.operator_id_type as u8);
21570 for val in &self.operator_id {
21571 __tmp.put_u8(*val);
21572 }
21573 if matches!(version, MavlinkVersion::V2) {
21574 let len = __tmp.len();
21575 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21576 } else {
21577 __tmp.len()
21578 }
21579 }
21580}
21581#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
21582#[doc = ""]
21583#[doc = "ID: 12903"]
21584#[derive(Debug, Clone, PartialEq)]
21585#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21586#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21587pub struct OPEN_DRONE_ID_SELF_ID_DATA {
21588 #[doc = "System ID (0 for broadcast)."]
21589 pub target_system: u8,
21590 #[doc = "Component ID (0 for broadcast)."]
21591 pub target_component: u8,
21592 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21593 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21594 pub id_or_mac: [u8; 20],
21595 #[doc = "Indicates the type of the description field."]
21596 pub description_type: MavOdidDescType,
21597 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21598 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21599 pub description: [u8; 23],
21600}
21601impl OPEN_DRONE_ID_SELF_ID_DATA {
21602 pub const ENCODED_LEN: usize = 46usize;
21603 pub const DEFAULT: Self = Self {
21604 target_system: 0_u8,
21605 target_component: 0_u8,
21606 id_or_mac: [0_u8; 20usize],
21607 description_type: MavOdidDescType::DEFAULT,
21608 description: [0_u8; 23usize],
21609 };
21610 #[cfg(feature = "arbitrary")]
21611 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21612 use arbitrary::{Arbitrary, Unstructured};
21613 let mut buf = [0u8; 1024];
21614 rng.fill_bytes(&mut buf);
21615 let mut unstructured = Unstructured::new(&buf);
21616 Self::arbitrary(&mut unstructured).unwrap_or_default()
21617 }
21618}
21619impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
21620 fn default() -> Self {
21621 Self::DEFAULT.clone()
21622 }
21623}
21624impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
21625 type Message = MavMessage;
21626 const ID: u32 = 12903u32;
21627 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
21628 const EXTRA_CRC: u8 = 249u8;
21629 const ENCODED_LEN: usize = 46usize;
21630 fn deser(
21631 _version: MavlinkVersion,
21632 __input: &[u8],
21633 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21634 let avail_len = __input.len();
21635 let mut payload_buf = [0; Self::ENCODED_LEN];
21636 let mut buf = if avail_len < Self::ENCODED_LEN {
21637 payload_buf[0..avail_len].copy_from_slice(__input);
21638 Bytes::new(&payload_buf)
21639 } else {
21640 Bytes::new(__input)
21641 };
21642 let mut __struct = Self::default();
21643 __struct.target_system = buf.get_u8();
21644 __struct.target_component = buf.get_u8();
21645 for v in &mut __struct.id_or_mac {
21646 let val = buf.get_u8();
21647 *v = val;
21648 }
21649 let tmp = buf.get_u8();
21650 __struct.description_type =
21651 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21652 enum_type: "MavOdidDescType",
21653 value: tmp as u32,
21654 })?;
21655 for v in &mut __struct.description {
21656 let val = buf.get_u8();
21657 *v = val;
21658 }
21659 Ok(__struct)
21660 }
21661 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21662 let mut __tmp = BytesMut::new(bytes);
21663 #[allow(clippy::absurd_extreme_comparisons)]
21664 #[allow(unused_comparisons)]
21665 if __tmp.remaining() < Self::ENCODED_LEN {
21666 panic!(
21667 "buffer is too small (need {} bytes, but got {})",
21668 Self::ENCODED_LEN,
21669 __tmp.remaining(),
21670 )
21671 }
21672 __tmp.put_u8(self.target_system);
21673 __tmp.put_u8(self.target_component);
21674 for val in &self.id_or_mac {
21675 __tmp.put_u8(*val);
21676 }
21677 __tmp.put_u8(self.description_type as u8);
21678 for val in &self.description {
21679 __tmp.put_u8(*val);
21680 }
21681 if matches!(version, MavlinkVersion::V2) {
21682 let len = __tmp.len();
21683 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21684 } else {
21685 __tmp.len()
21686 }
21687 }
21688}
21689#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
21690#[doc = ""]
21691#[doc = "ID: 12904"]
21692#[derive(Debug, Clone, PartialEq)]
21693#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21695pub struct OPEN_DRONE_ID_SYSTEM_DATA {
21696 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
21697 pub operator_latitude: i32,
21698 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
21699 pub operator_longitude: i32,
21700 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
21701 pub area_ceiling: f32,
21702 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
21703 pub area_floor: f32,
21704 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
21705 pub operator_altitude_geo: f32,
21706 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21707 pub timestamp: u32,
21708 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
21709 pub area_count: u16,
21710 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
21711 pub area_radius: u16,
21712 #[doc = "System ID (0 for broadcast)."]
21713 pub target_system: u8,
21714 #[doc = "Component ID (0 for broadcast)."]
21715 pub target_component: u8,
21716 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21717 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21718 pub id_or_mac: [u8; 20],
21719 #[doc = "Specifies the operator location type."]
21720 pub operator_location_type: MavOdidOperatorLocationType,
21721 #[doc = "Specifies the classification type of the UA."]
21722 pub classification_type: MavOdidClassificationType,
21723 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
21724 pub category_eu: MavOdidCategoryEu,
21725 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
21726 pub class_eu: MavOdidClassEu,
21727}
21728impl OPEN_DRONE_ID_SYSTEM_DATA {
21729 pub const ENCODED_LEN: usize = 54usize;
21730 pub const DEFAULT: Self = Self {
21731 operator_latitude: 0_i32,
21732 operator_longitude: 0_i32,
21733 area_ceiling: 0.0_f32,
21734 area_floor: 0.0_f32,
21735 operator_altitude_geo: 0.0_f32,
21736 timestamp: 0_u32,
21737 area_count: 0_u16,
21738 area_radius: 0_u16,
21739 target_system: 0_u8,
21740 target_component: 0_u8,
21741 id_or_mac: [0_u8; 20usize],
21742 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
21743 classification_type: MavOdidClassificationType::DEFAULT,
21744 category_eu: MavOdidCategoryEu::DEFAULT,
21745 class_eu: MavOdidClassEu::DEFAULT,
21746 };
21747 #[cfg(feature = "arbitrary")]
21748 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21749 use arbitrary::{Arbitrary, Unstructured};
21750 let mut buf = [0u8; 1024];
21751 rng.fill_bytes(&mut buf);
21752 let mut unstructured = Unstructured::new(&buf);
21753 Self::arbitrary(&mut unstructured).unwrap_or_default()
21754 }
21755}
21756impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
21757 fn default() -> Self {
21758 Self::DEFAULT.clone()
21759 }
21760}
21761impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
21762 type Message = MavMessage;
21763 const ID: u32 = 12904u32;
21764 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
21765 const EXTRA_CRC: u8 = 77u8;
21766 const ENCODED_LEN: usize = 54usize;
21767 fn deser(
21768 _version: MavlinkVersion,
21769 __input: &[u8],
21770 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21771 let avail_len = __input.len();
21772 let mut payload_buf = [0; Self::ENCODED_LEN];
21773 let mut buf = if avail_len < Self::ENCODED_LEN {
21774 payload_buf[0..avail_len].copy_from_slice(__input);
21775 Bytes::new(&payload_buf)
21776 } else {
21777 Bytes::new(__input)
21778 };
21779 let mut __struct = Self::default();
21780 __struct.operator_latitude = buf.get_i32_le();
21781 __struct.operator_longitude = buf.get_i32_le();
21782 __struct.area_ceiling = buf.get_f32_le();
21783 __struct.area_floor = buf.get_f32_le();
21784 __struct.operator_altitude_geo = buf.get_f32_le();
21785 __struct.timestamp = buf.get_u32_le();
21786 __struct.area_count = buf.get_u16_le();
21787 __struct.area_radius = buf.get_u16_le();
21788 __struct.target_system = buf.get_u8();
21789 __struct.target_component = buf.get_u8();
21790 for v in &mut __struct.id_or_mac {
21791 let val = buf.get_u8();
21792 *v = val;
21793 }
21794 let tmp = buf.get_u8();
21795 __struct.operator_location_type =
21796 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21797 enum_type: "MavOdidOperatorLocationType",
21798 value: tmp as u32,
21799 })?;
21800 let tmp = buf.get_u8();
21801 __struct.classification_type =
21802 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21803 enum_type: "MavOdidClassificationType",
21804 value: tmp as u32,
21805 })?;
21806 let tmp = buf.get_u8();
21807 __struct.category_eu =
21808 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21809 enum_type: "MavOdidCategoryEu",
21810 value: tmp as u32,
21811 })?;
21812 let tmp = buf.get_u8();
21813 __struct.class_eu =
21814 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21815 enum_type: "MavOdidClassEu",
21816 value: tmp as u32,
21817 })?;
21818 Ok(__struct)
21819 }
21820 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21821 let mut __tmp = BytesMut::new(bytes);
21822 #[allow(clippy::absurd_extreme_comparisons)]
21823 #[allow(unused_comparisons)]
21824 if __tmp.remaining() < Self::ENCODED_LEN {
21825 panic!(
21826 "buffer is too small (need {} bytes, but got {})",
21827 Self::ENCODED_LEN,
21828 __tmp.remaining(),
21829 )
21830 }
21831 __tmp.put_i32_le(self.operator_latitude);
21832 __tmp.put_i32_le(self.operator_longitude);
21833 __tmp.put_f32_le(self.area_ceiling);
21834 __tmp.put_f32_le(self.area_floor);
21835 __tmp.put_f32_le(self.operator_altitude_geo);
21836 __tmp.put_u32_le(self.timestamp);
21837 __tmp.put_u16_le(self.area_count);
21838 __tmp.put_u16_le(self.area_radius);
21839 __tmp.put_u8(self.target_system);
21840 __tmp.put_u8(self.target_component);
21841 for val in &self.id_or_mac {
21842 __tmp.put_u8(*val);
21843 }
21844 __tmp.put_u8(self.operator_location_type as u8);
21845 __tmp.put_u8(self.classification_type as u8);
21846 __tmp.put_u8(self.category_eu as u8);
21847 __tmp.put_u8(self.class_eu as u8);
21848 if matches!(version, MavlinkVersion::V2) {
21849 let len = __tmp.len();
21850 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21851 } else {
21852 __tmp.len()
21853 }
21854 }
21855}
21856#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
21857#[doc = ""]
21858#[doc = "ID: 12919"]
21859#[derive(Debug, Clone, PartialEq)]
21860#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21861#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21862pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21863 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
21864 pub operator_latitude: i32,
21865 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
21866 pub operator_longitude: i32,
21867 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
21868 pub operator_altitude_geo: f32,
21869 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21870 pub timestamp: u32,
21871 #[doc = "System ID (0 for broadcast)."]
21872 pub target_system: u8,
21873 #[doc = "Component ID (0 for broadcast)."]
21874 pub target_component: u8,
21875}
21876impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21877 pub const ENCODED_LEN: usize = 18usize;
21878 pub const DEFAULT: Self = Self {
21879 operator_latitude: 0_i32,
21880 operator_longitude: 0_i32,
21881 operator_altitude_geo: 0.0_f32,
21882 timestamp: 0_u32,
21883 target_system: 0_u8,
21884 target_component: 0_u8,
21885 };
21886 #[cfg(feature = "arbitrary")]
21887 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21888 use arbitrary::{Arbitrary, Unstructured};
21889 let mut buf = [0u8; 1024];
21890 rng.fill_bytes(&mut buf);
21891 let mut unstructured = Unstructured::new(&buf);
21892 Self::arbitrary(&mut unstructured).unwrap_or_default()
21893 }
21894}
21895impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21896 fn default() -> Self {
21897 Self::DEFAULT.clone()
21898 }
21899}
21900impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21901 type Message = MavMessage;
21902 const ID: u32 = 12919u32;
21903 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
21904 const EXTRA_CRC: u8 = 7u8;
21905 const ENCODED_LEN: usize = 18usize;
21906 fn deser(
21907 _version: MavlinkVersion,
21908 __input: &[u8],
21909 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21910 let avail_len = __input.len();
21911 let mut payload_buf = [0; Self::ENCODED_LEN];
21912 let mut buf = if avail_len < Self::ENCODED_LEN {
21913 payload_buf[0..avail_len].copy_from_slice(__input);
21914 Bytes::new(&payload_buf)
21915 } else {
21916 Bytes::new(__input)
21917 };
21918 let mut __struct = Self::default();
21919 __struct.operator_latitude = buf.get_i32_le();
21920 __struct.operator_longitude = buf.get_i32_le();
21921 __struct.operator_altitude_geo = buf.get_f32_le();
21922 __struct.timestamp = buf.get_u32_le();
21923 __struct.target_system = buf.get_u8();
21924 __struct.target_component = buf.get_u8();
21925 Ok(__struct)
21926 }
21927 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21928 let mut __tmp = BytesMut::new(bytes);
21929 #[allow(clippy::absurd_extreme_comparisons)]
21930 #[allow(unused_comparisons)]
21931 if __tmp.remaining() < Self::ENCODED_LEN {
21932 panic!(
21933 "buffer is too small (need {} bytes, but got {})",
21934 Self::ENCODED_LEN,
21935 __tmp.remaining(),
21936 )
21937 }
21938 __tmp.put_i32_le(self.operator_latitude);
21939 __tmp.put_i32_le(self.operator_longitude);
21940 __tmp.put_f32_le(self.operator_altitude_geo);
21941 __tmp.put_u32_le(self.timestamp);
21942 __tmp.put_u8(self.target_system);
21943 __tmp.put_u8(self.target_component);
21944 if matches!(version, MavlinkVersion::V2) {
21945 let len = __tmp.len();
21946 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21947 } else {
21948 __tmp.len()
21949 }
21950 }
21951}
21952#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
21953#[doc = ""]
21954#[doc = "ID: 100"]
21955#[derive(Debug, Clone, PartialEq)]
21956#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21957#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21958pub struct OPTICAL_FLOW_DATA {
21959 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21960 pub time_usec: u64,
21961 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
21962 pub flow_comp_m_x: f32,
21963 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
21964 pub flow_comp_m_y: f32,
21965 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
21966 pub ground_distance: f32,
21967 #[doc = "Flow in x-sensor direction"]
21968 pub flow_x: i16,
21969 #[doc = "Flow in y-sensor direction"]
21970 pub flow_y: i16,
21971 #[doc = "Sensor ID"]
21972 pub sensor_id: u8,
21973 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
21974 pub quality: u8,
21975 #[doc = "Flow rate about X axis"]
21976 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21977 pub flow_rate_x: f32,
21978 #[doc = "Flow rate about Y axis"]
21979 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21980 pub flow_rate_y: f32,
21981}
21982impl OPTICAL_FLOW_DATA {
21983 pub const ENCODED_LEN: usize = 34usize;
21984 pub const DEFAULT: Self = Self {
21985 time_usec: 0_u64,
21986 flow_comp_m_x: 0.0_f32,
21987 flow_comp_m_y: 0.0_f32,
21988 ground_distance: 0.0_f32,
21989 flow_x: 0_i16,
21990 flow_y: 0_i16,
21991 sensor_id: 0_u8,
21992 quality: 0_u8,
21993 flow_rate_x: 0.0_f32,
21994 flow_rate_y: 0.0_f32,
21995 };
21996 #[cfg(feature = "arbitrary")]
21997 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21998 use arbitrary::{Arbitrary, Unstructured};
21999 let mut buf = [0u8; 1024];
22000 rng.fill_bytes(&mut buf);
22001 let mut unstructured = Unstructured::new(&buf);
22002 Self::arbitrary(&mut unstructured).unwrap_or_default()
22003 }
22004}
22005impl Default for OPTICAL_FLOW_DATA {
22006 fn default() -> Self {
22007 Self::DEFAULT.clone()
22008 }
22009}
22010impl MessageData for OPTICAL_FLOW_DATA {
22011 type Message = MavMessage;
22012 const ID: u32 = 100u32;
22013 const NAME: &'static str = "OPTICAL_FLOW";
22014 const EXTRA_CRC: u8 = 175u8;
22015 const ENCODED_LEN: usize = 34usize;
22016 fn deser(
22017 _version: MavlinkVersion,
22018 __input: &[u8],
22019 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22020 let avail_len = __input.len();
22021 let mut payload_buf = [0; Self::ENCODED_LEN];
22022 let mut buf = if avail_len < Self::ENCODED_LEN {
22023 payload_buf[0..avail_len].copy_from_slice(__input);
22024 Bytes::new(&payload_buf)
22025 } else {
22026 Bytes::new(__input)
22027 };
22028 let mut __struct = Self::default();
22029 __struct.time_usec = buf.get_u64_le();
22030 __struct.flow_comp_m_x = buf.get_f32_le();
22031 __struct.flow_comp_m_y = buf.get_f32_le();
22032 __struct.ground_distance = buf.get_f32_le();
22033 __struct.flow_x = buf.get_i16_le();
22034 __struct.flow_y = buf.get_i16_le();
22035 __struct.sensor_id = buf.get_u8();
22036 __struct.quality = buf.get_u8();
22037 __struct.flow_rate_x = buf.get_f32_le();
22038 __struct.flow_rate_y = buf.get_f32_le();
22039 Ok(__struct)
22040 }
22041 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22042 let mut __tmp = BytesMut::new(bytes);
22043 #[allow(clippy::absurd_extreme_comparisons)]
22044 #[allow(unused_comparisons)]
22045 if __tmp.remaining() < Self::ENCODED_LEN {
22046 panic!(
22047 "buffer is too small (need {} bytes, but got {})",
22048 Self::ENCODED_LEN,
22049 __tmp.remaining(),
22050 )
22051 }
22052 __tmp.put_u64_le(self.time_usec);
22053 __tmp.put_f32_le(self.flow_comp_m_x);
22054 __tmp.put_f32_le(self.flow_comp_m_y);
22055 __tmp.put_f32_le(self.ground_distance);
22056 __tmp.put_i16_le(self.flow_x);
22057 __tmp.put_i16_le(self.flow_y);
22058 __tmp.put_u8(self.sensor_id);
22059 __tmp.put_u8(self.quality);
22060 if matches!(version, MavlinkVersion::V2) {
22061 __tmp.put_f32_le(self.flow_rate_x);
22062 __tmp.put_f32_le(self.flow_rate_y);
22063 let len = __tmp.len();
22064 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22065 } else {
22066 __tmp.len()
22067 }
22068 }
22069}
22070#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
22071#[doc = ""]
22072#[doc = "ID: 106"]
22073#[derive(Debug, Clone, PartialEq)]
22074#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22075#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22076pub struct OPTICAL_FLOW_RAD_DATA {
22077 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22078 pub time_usec: u64,
22079 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
22080 pub integration_time_us: u32,
22081 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
22082 pub integrated_x: f32,
22083 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
22084 pub integrated_y: f32,
22085 #[doc = "RH rotation around X axis"]
22086 pub integrated_xgyro: f32,
22087 #[doc = "RH rotation around Y axis"]
22088 pub integrated_ygyro: f32,
22089 #[doc = "RH rotation around Z axis"]
22090 pub integrated_zgyro: f32,
22091 #[doc = "Time since the distance was sampled."]
22092 pub time_delta_distance_us: u32,
22093 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
22094 pub distance: f32,
22095 #[doc = "Temperature"]
22096 pub temperature: i16,
22097 #[doc = "Sensor ID"]
22098 pub sensor_id: u8,
22099 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
22100 pub quality: u8,
22101}
22102impl OPTICAL_FLOW_RAD_DATA {
22103 pub const ENCODED_LEN: usize = 44usize;
22104 pub const DEFAULT: Self = Self {
22105 time_usec: 0_u64,
22106 integration_time_us: 0_u32,
22107 integrated_x: 0.0_f32,
22108 integrated_y: 0.0_f32,
22109 integrated_xgyro: 0.0_f32,
22110 integrated_ygyro: 0.0_f32,
22111 integrated_zgyro: 0.0_f32,
22112 time_delta_distance_us: 0_u32,
22113 distance: 0.0_f32,
22114 temperature: 0_i16,
22115 sensor_id: 0_u8,
22116 quality: 0_u8,
22117 };
22118 #[cfg(feature = "arbitrary")]
22119 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22120 use arbitrary::{Arbitrary, Unstructured};
22121 let mut buf = [0u8; 1024];
22122 rng.fill_bytes(&mut buf);
22123 let mut unstructured = Unstructured::new(&buf);
22124 Self::arbitrary(&mut unstructured).unwrap_or_default()
22125 }
22126}
22127impl Default for OPTICAL_FLOW_RAD_DATA {
22128 fn default() -> Self {
22129 Self::DEFAULT.clone()
22130 }
22131}
22132impl MessageData for OPTICAL_FLOW_RAD_DATA {
22133 type Message = MavMessage;
22134 const ID: u32 = 106u32;
22135 const NAME: &'static str = "OPTICAL_FLOW_RAD";
22136 const EXTRA_CRC: u8 = 138u8;
22137 const ENCODED_LEN: usize = 44usize;
22138 fn deser(
22139 _version: MavlinkVersion,
22140 __input: &[u8],
22141 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22142 let avail_len = __input.len();
22143 let mut payload_buf = [0; Self::ENCODED_LEN];
22144 let mut buf = if avail_len < Self::ENCODED_LEN {
22145 payload_buf[0..avail_len].copy_from_slice(__input);
22146 Bytes::new(&payload_buf)
22147 } else {
22148 Bytes::new(__input)
22149 };
22150 let mut __struct = Self::default();
22151 __struct.time_usec = buf.get_u64_le();
22152 __struct.integration_time_us = buf.get_u32_le();
22153 __struct.integrated_x = buf.get_f32_le();
22154 __struct.integrated_y = buf.get_f32_le();
22155 __struct.integrated_xgyro = buf.get_f32_le();
22156 __struct.integrated_ygyro = buf.get_f32_le();
22157 __struct.integrated_zgyro = buf.get_f32_le();
22158 __struct.time_delta_distance_us = buf.get_u32_le();
22159 __struct.distance = buf.get_f32_le();
22160 __struct.temperature = buf.get_i16_le();
22161 __struct.sensor_id = buf.get_u8();
22162 __struct.quality = buf.get_u8();
22163 Ok(__struct)
22164 }
22165 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22166 let mut __tmp = BytesMut::new(bytes);
22167 #[allow(clippy::absurd_extreme_comparisons)]
22168 #[allow(unused_comparisons)]
22169 if __tmp.remaining() < Self::ENCODED_LEN {
22170 panic!(
22171 "buffer is too small (need {} bytes, but got {})",
22172 Self::ENCODED_LEN,
22173 __tmp.remaining(),
22174 )
22175 }
22176 __tmp.put_u64_le(self.time_usec);
22177 __tmp.put_u32_le(self.integration_time_us);
22178 __tmp.put_f32_le(self.integrated_x);
22179 __tmp.put_f32_le(self.integrated_y);
22180 __tmp.put_f32_le(self.integrated_xgyro);
22181 __tmp.put_f32_le(self.integrated_ygyro);
22182 __tmp.put_f32_le(self.integrated_zgyro);
22183 __tmp.put_u32_le(self.time_delta_distance_us);
22184 __tmp.put_f32_le(self.distance);
22185 __tmp.put_i16_le(self.temperature);
22186 __tmp.put_u8(self.sensor_id);
22187 __tmp.put_u8(self.quality);
22188 if matches!(version, MavlinkVersion::V2) {
22189 let len = __tmp.len();
22190 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22191 } else {
22192 __tmp.len()
22193 }
22194 }
22195}
22196#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
22197#[doc = ""]
22198#[doc = "ID: 360"]
22199#[derive(Debug, Clone, PartialEq)]
22200#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22201#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22202pub struct ORBIT_EXECUTION_STATUS_DATA {
22203 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22204 pub time_usec: u64,
22205 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
22206 pub radius: f32,
22207 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22208 pub x: i32,
22209 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22210 pub y: i32,
22211 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
22212 pub z: f32,
22213 #[doc = "The coordinate system of the fields: x, y, z."]
22214 pub frame: MavFrame,
22215}
22216impl ORBIT_EXECUTION_STATUS_DATA {
22217 pub const ENCODED_LEN: usize = 25usize;
22218 pub const DEFAULT: Self = Self {
22219 time_usec: 0_u64,
22220 radius: 0.0_f32,
22221 x: 0_i32,
22222 y: 0_i32,
22223 z: 0.0_f32,
22224 frame: MavFrame::DEFAULT,
22225 };
22226 #[cfg(feature = "arbitrary")]
22227 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22228 use arbitrary::{Arbitrary, Unstructured};
22229 let mut buf = [0u8; 1024];
22230 rng.fill_bytes(&mut buf);
22231 let mut unstructured = Unstructured::new(&buf);
22232 Self::arbitrary(&mut unstructured).unwrap_or_default()
22233 }
22234}
22235impl Default for ORBIT_EXECUTION_STATUS_DATA {
22236 fn default() -> Self {
22237 Self::DEFAULT.clone()
22238 }
22239}
22240impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
22241 type Message = MavMessage;
22242 const ID: u32 = 360u32;
22243 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
22244 const EXTRA_CRC: u8 = 11u8;
22245 const ENCODED_LEN: usize = 25usize;
22246 fn deser(
22247 _version: MavlinkVersion,
22248 __input: &[u8],
22249 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22250 let avail_len = __input.len();
22251 let mut payload_buf = [0; Self::ENCODED_LEN];
22252 let mut buf = if avail_len < Self::ENCODED_LEN {
22253 payload_buf[0..avail_len].copy_from_slice(__input);
22254 Bytes::new(&payload_buf)
22255 } else {
22256 Bytes::new(__input)
22257 };
22258 let mut __struct = Self::default();
22259 __struct.time_usec = buf.get_u64_le();
22260 __struct.radius = buf.get_f32_le();
22261 __struct.x = buf.get_i32_le();
22262 __struct.y = buf.get_i32_le();
22263 __struct.z = buf.get_f32_le();
22264 let tmp = buf.get_u8();
22265 __struct.frame =
22266 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22267 enum_type: "MavFrame",
22268 value: tmp as u32,
22269 })?;
22270 Ok(__struct)
22271 }
22272 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22273 let mut __tmp = BytesMut::new(bytes);
22274 #[allow(clippy::absurd_extreme_comparisons)]
22275 #[allow(unused_comparisons)]
22276 if __tmp.remaining() < Self::ENCODED_LEN {
22277 panic!(
22278 "buffer is too small (need {} bytes, but got {})",
22279 Self::ENCODED_LEN,
22280 __tmp.remaining(),
22281 )
22282 }
22283 __tmp.put_u64_le(self.time_usec);
22284 __tmp.put_f32_le(self.radius);
22285 __tmp.put_i32_le(self.x);
22286 __tmp.put_i32_le(self.y);
22287 __tmp.put_f32_le(self.z);
22288 __tmp.put_u8(self.frame as u8);
22289 if matches!(version, MavlinkVersion::V2) {
22290 let len = __tmp.len();
22291 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22292 } else {
22293 __tmp.len()
22294 }
22295 }
22296}
22297#[doc = "Response from a PARAM_EXT_SET message."]
22298#[doc = ""]
22299#[doc = "ID: 324"]
22300#[derive(Debug, Clone, PartialEq)]
22301#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22302#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22303pub struct PARAM_EXT_ACK_DATA {
22304 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22305 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22306 pub param_id: [u8; 16],
22307 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
22308 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22309 pub param_value: [u8; 128],
22310 #[doc = "Parameter type."]
22311 pub param_type: MavParamExtType,
22312 #[doc = "Result code."]
22313 pub param_result: ParamAck,
22314}
22315impl PARAM_EXT_ACK_DATA {
22316 pub const ENCODED_LEN: usize = 146usize;
22317 pub const DEFAULT: Self = Self {
22318 param_id: [0_u8; 16usize],
22319 param_value: [0_u8; 128usize],
22320 param_type: MavParamExtType::DEFAULT,
22321 param_result: ParamAck::DEFAULT,
22322 };
22323 #[cfg(feature = "arbitrary")]
22324 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22325 use arbitrary::{Arbitrary, Unstructured};
22326 let mut buf = [0u8; 1024];
22327 rng.fill_bytes(&mut buf);
22328 let mut unstructured = Unstructured::new(&buf);
22329 Self::arbitrary(&mut unstructured).unwrap_or_default()
22330 }
22331}
22332impl Default for PARAM_EXT_ACK_DATA {
22333 fn default() -> Self {
22334 Self::DEFAULT.clone()
22335 }
22336}
22337impl MessageData for PARAM_EXT_ACK_DATA {
22338 type Message = MavMessage;
22339 const ID: u32 = 324u32;
22340 const NAME: &'static str = "PARAM_EXT_ACK";
22341 const EXTRA_CRC: u8 = 132u8;
22342 const ENCODED_LEN: usize = 146usize;
22343 fn deser(
22344 _version: MavlinkVersion,
22345 __input: &[u8],
22346 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22347 let avail_len = __input.len();
22348 let mut payload_buf = [0; Self::ENCODED_LEN];
22349 let mut buf = if avail_len < Self::ENCODED_LEN {
22350 payload_buf[0..avail_len].copy_from_slice(__input);
22351 Bytes::new(&payload_buf)
22352 } else {
22353 Bytes::new(__input)
22354 };
22355 let mut __struct = Self::default();
22356 for v in &mut __struct.param_id {
22357 let val = buf.get_u8();
22358 *v = val;
22359 }
22360 for v in &mut __struct.param_value {
22361 let val = buf.get_u8();
22362 *v = val;
22363 }
22364 let tmp = buf.get_u8();
22365 __struct.param_type =
22366 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22367 enum_type: "MavParamExtType",
22368 value: tmp as u32,
22369 })?;
22370 let tmp = buf.get_u8();
22371 __struct.param_result =
22372 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22373 enum_type: "ParamAck",
22374 value: tmp as u32,
22375 })?;
22376 Ok(__struct)
22377 }
22378 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22379 let mut __tmp = BytesMut::new(bytes);
22380 #[allow(clippy::absurd_extreme_comparisons)]
22381 #[allow(unused_comparisons)]
22382 if __tmp.remaining() < Self::ENCODED_LEN {
22383 panic!(
22384 "buffer is too small (need {} bytes, but got {})",
22385 Self::ENCODED_LEN,
22386 __tmp.remaining(),
22387 )
22388 }
22389 for val in &self.param_id {
22390 __tmp.put_u8(*val);
22391 }
22392 for val in &self.param_value {
22393 __tmp.put_u8(*val);
22394 }
22395 __tmp.put_u8(self.param_type as u8);
22396 __tmp.put_u8(self.param_result as u8);
22397 if matches!(version, MavlinkVersion::V2) {
22398 let len = __tmp.len();
22399 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22400 } else {
22401 __tmp.len()
22402 }
22403 }
22404}
22405#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
22406#[doc = ""]
22407#[doc = "ID: 321"]
22408#[derive(Debug, Clone, PartialEq)]
22409#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22410#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22411pub struct PARAM_EXT_REQUEST_LIST_DATA {
22412 #[doc = "System ID"]
22413 pub target_system: u8,
22414 #[doc = "Component ID"]
22415 pub target_component: u8,
22416}
22417impl PARAM_EXT_REQUEST_LIST_DATA {
22418 pub const ENCODED_LEN: usize = 2usize;
22419 pub const DEFAULT: Self = Self {
22420 target_system: 0_u8,
22421 target_component: 0_u8,
22422 };
22423 #[cfg(feature = "arbitrary")]
22424 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22425 use arbitrary::{Arbitrary, Unstructured};
22426 let mut buf = [0u8; 1024];
22427 rng.fill_bytes(&mut buf);
22428 let mut unstructured = Unstructured::new(&buf);
22429 Self::arbitrary(&mut unstructured).unwrap_or_default()
22430 }
22431}
22432impl Default for PARAM_EXT_REQUEST_LIST_DATA {
22433 fn default() -> Self {
22434 Self::DEFAULT.clone()
22435 }
22436}
22437impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
22438 type Message = MavMessage;
22439 const ID: u32 = 321u32;
22440 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
22441 const EXTRA_CRC: u8 = 88u8;
22442 const ENCODED_LEN: usize = 2usize;
22443 fn deser(
22444 _version: MavlinkVersion,
22445 __input: &[u8],
22446 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22447 let avail_len = __input.len();
22448 let mut payload_buf = [0; Self::ENCODED_LEN];
22449 let mut buf = if avail_len < Self::ENCODED_LEN {
22450 payload_buf[0..avail_len].copy_from_slice(__input);
22451 Bytes::new(&payload_buf)
22452 } else {
22453 Bytes::new(__input)
22454 };
22455 let mut __struct = Self::default();
22456 __struct.target_system = buf.get_u8();
22457 __struct.target_component = buf.get_u8();
22458 Ok(__struct)
22459 }
22460 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22461 let mut __tmp = BytesMut::new(bytes);
22462 #[allow(clippy::absurd_extreme_comparisons)]
22463 #[allow(unused_comparisons)]
22464 if __tmp.remaining() < Self::ENCODED_LEN {
22465 panic!(
22466 "buffer is too small (need {} bytes, but got {})",
22467 Self::ENCODED_LEN,
22468 __tmp.remaining(),
22469 )
22470 }
22471 __tmp.put_u8(self.target_system);
22472 __tmp.put_u8(self.target_component);
22473 if matches!(version, MavlinkVersion::V2) {
22474 let len = __tmp.len();
22475 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22476 } else {
22477 __tmp.len()
22478 }
22479 }
22480}
22481#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
22482#[doc = ""]
22483#[doc = "ID: 320"]
22484#[derive(Debug, Clone, PartialEq)]
22485#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22486#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22487pub struct PARAM_EXT_REQUEST_READ_DATA {
22488 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
22489 pub param_index: i16,
22490 #[doc = "System ID"]
22491 pub target_system: u8,
22492 #[doc = "Component ID"]
22493 pub target_component: u8,
22494 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22495 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22496 pub param_id: [u8; 16],
22497}
22498impl PARAM_EXT_REQUEST_READ_DATA {
22499 pub const ENCODED_LEN: usize = 20usize;
22500 pub const DEFAULT: Self = Self {
22501 param_index: 0_i16,
22502 target_system: 0_u8,
22503 target_component: 0_u8,
22504 param_id: [0_u8; 16usize],
22505 };
22506 #[cfg(feature = "arbitrary")]
22507 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22508 use arbitrary::{Arbitrary, Unstructured};
22509 let mut buf = [0u8; 1024];
22510 rng.fill_bytes(&mut buf);
22511 let mut unstructured = Unstructured::new(&buf);
22512 Self::arbitrary(&mut unstructured).unwrap_or_default()
22513 }
22514}
22515impl Default for PARAM_EXT_REQUEST_READ_DATA {
22516 fn default() -> Self {
22517 Self::DEFAULT.clone()
22518 }
22519}
22520impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
22521 type Message = MavMessage;
22522 const ID: u32 = 320u32;
22523 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
22524 const EXTRA_CRC: u8 = 243u8;
22525 const ENCODED_LEN: usize = 20usize;
22526 fn deser(
22527 _version: MavlinkVersion,
22528 __input: &[u8],
22529 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22530 let avail_len = __input.len();
22531 let mut payload_buf = [0; Self::ENCODED_LEN];
22532 let mut buf = if avail_len < Self::ENCODED_LEN {
22533 payload_buf[0..avail_len].copy_from_slice(__input);
22534 Bytes::new(&payload_buf)
22535 } else {
22536 Bytes::new(__input)
22537 };
22538 let mut __struct = Self::default();
22539 __struct.param_index = buf.get_i16_le();
22540 __struct.target_system = buf.get_u8();
22541 __struct.target_component = buf.get_u8();
22542 for v in &mut __struct.param_id {
22543 let val = buf.get_u8();
22544 *v = val;
22545 }
22546 Ok(__struct)
22547 }
22548 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22549 let mut __tmp = BytesMut::new(bytes);
22550 #[allow(clippy::absurd_extreme_comparisons)]
22551 #[allow(unused_comparisons)]
22552 if __tmp.remaining() < Self::ENCODED_LEN {
22553 panic!(
22554 "buffer is too small (need {} bytes, but got {})",
22555 Self::ENCODED_LEN,
22556 __tmp.remaining(),
22557 )
22558 }
22559 __tmp.put_i16_le(self.param_index);
22560 __tmp.put_u8(self.target_system);
22561 __tmp.put_u8(self.target_component);
22562 for val in &self.param_id {
22563 __tmp.put_u8(*val);
22564 }
22565 if matches!(version, MavlinkVersion::V2) {
22566 let len = __tmp.len();
22567 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22568 } else {
22569 __tmp.len()
22570 }
22571 }
22572}
22573#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
22574#[doc = ""]
22575#[doc = "ID: 323"]
22576#[derive(Debug, Clone, PartialEq)]
22577#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22578#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22579pub struct PARAM_EXT_SET_DATA {
22580 #[doc = "System ID"]
22581 pub target_system: u8,
22582 #[doc = "Component ID"]
22583 pub target_component: u8,
22584 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22585 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22586 pub param_id: [u8; 16],
22587 #[doc = "Parameter value"]
22588 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22589 pub param_value: [u8; 128],
22590 #[doc = "Parameter type."]
22591 pub param_type: MavParamExtType,
22592}
22593impl PARAM_EXT_SET_DATA {
22594 pub const ENCODED_LEN: usize = 147usize;
22595 pub const DEFAULT: Self = Self {
22596 target_system: 0_u8,
22597 target_component: 0_u8,
22598 param_id: [0_u8; 16usize],
22599 param_value: [0_u8; 128usize],
22600 param_type: MavParamExtType::DEFAULT,
22601 };
22602 #[cfg(feature = "arbitrary")]
22603 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22604 use arbitrary::{Arbitrary, Unstructured};
22605 let mut buf = [0u8; 1024];
22606 rng.fill_bytes(&mut buf);
22607 let mut unstructured = Unstructured::new(&buf);
22608 Self::arbitrary(&mut unstructured).unwrap_or_default()
22609 }
22610}
22611impl Default for PARAM_EXT_SET_DATA {
22612 fn default() -> Self {
22613 Self::DEFAULT.clone()
22614 }
22615}
22616impl MessageData for PARAM_EXT_SET_DATA {
22617 type Message = MavMessage;
22618 const ID: u32 = 323u32;
22619 const NAME: &'static str = "PARAM_EXT_SET";
22620 const EXTRA_CRC: u8 = 78u8;
22621 const ENCODED_LEN: usize = 147usize;
22622 fn deser(
22623 _version: MavlinkVersion,
22624 __input: &[u8],
22625 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22626 let avail_len = __input.len();
22627 let mut payload_buf = [0; Self::ENCODED_LEN];
22628 let mut buf = if avail_len < Self::ENCODED_LEN {
22629 payload_buf[0..avail_len].copy_from_slice(__input);
22630 Bytes::new(&payload_buf)
22631 } else {
22632 Bytes::new(__input)
22633 };
22634 let mut __struct = Self::default();
22635 __struct.target_system = buf.get_u8();
22636 __struct.target_component = buf.get_u8();
22637 for v in &mut __struct.param_id {
22638 let val = buf.get_u8();
22639 *v = val;
22640 }
22641 for v in &mut __struct.param_value {
22642 let val = buf.get_u8();
22643 *v = val;
22644 }
22645 let tmp = buf.get_u8();
22646 __struct.param_type =
22647 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22648 enum_type: "MavParamExtType",
22649 value: tmp as u32,
22650 })?;
22651 Ok(__struct)
22652 }
22653 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22654 let mut __tmp = BytesMut::new(bytes);
22655 #[allow(clippy::absurd_extreme_comparisons)]
22656 #[allow(unused_comparisons)]
22657 if __tmp.remaining() < Self::ENCODED_LEN {
22658 panic!(
22659 "buffer is too small (need {} bytes, but got {})",
22660 Self::ENCODED_LEN,
22661 __tmp.remaining(),
22662 )
22663 }
22664 __tmp.put_u8(self.target_system);
22665 __tmp.put_u8(self.target_component);
22666 for val in &self.param_id {
22667 __tmp.put_u8(*val);
22668 }
22669 for val in &self.param_value {
22670 __tmp.put_u8(*val);
22671 }
22672 __tmp.put_u8(self.param_type as u8);
22673 if matches!(version, MavlinkVersion::V2) {
22674 let len = __tmp.len();
22675 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22676 } else {
22677 __tmp.len()
22678 }
22679 }
22680}
22681#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
22682#[doc = ""]
22683#[doc = "ID: 322"]
22684#[derive(Debug, Clone, PartialEq)]
22685#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22686#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22687pub struct PARAM_EXT_VALUE_DATA {
22688 #[doc = "Total number of parameters"]
22689 pub param_count: u16,
22690 #[doc = "Index of this parameter"]
22691 pub param_index: u16,
22692 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22693 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22694 pub param_id: [u8; 16],
22695 #[doc = "Parameter value"]
22696 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22697 pub param_value: [u8; 128],
22698 #[doc = "Parameter type."]
22699 pub param_type: MavParamExtType,
22700}
22701impl PARAM_EXT_VALUE_DATA {
22702 pub const ENCODED_LEN: usize = 149usize;
22703 pub const DEFAULT: Self = Self {
22704 param_count: 0_u16,
22705 param_index: 0_u16,
22706 param_id: [0_u8; 16usize],
22707 param_value: [0_u8; 128usize],
22708 param_type: MavParamExtType::DEFAULT,
22709 };
22710 #[cfg(feature = "arbitrary")]
22711 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22712 use arbitrary::{Arbitrary, Unstructured};
22713 let mut buf = [0u8; 1024];
22714 rng.fill_bytes(&mut buf);
22715 let mut unstructured = Unstructured::new(&buf);
22716 Self::arbitrary(&mut unstructured).unwrap_or_default()
22717 }
22718}
22719impl Default for PARAM_EXT_VALUE_DATA {
22720 fn default() -> Self {
22721 Self::DEFAULT.clone()
22722 }
22723}
22724impl MessageData for PARAM_EXT_VALUE_DATA {
22725 type Message = MavMessage;
22726 const ID: u32 = 322u32;
22727 const NAME: &'static str = "PARAM_EXT_VALUE";
22728 const EXTRA_CRC: u8 = 243u8;
22729 const ENCODED_LEN: usize = 149usize;
22730 fn deser(
22731 _version: MavlinkVersion,
22732 __input: &[u8],
22733 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22734 let avail_len = __input.len();
22735 let mut payload_buf = [0; Self::ENCODED_LEN];
22736 let mut buf = if avail_len < Self::ENCODED_LEN {
22737 payload_buf[0..avail_len].copy_from_slice(__input);
22738 Bytes::new(&payload_buf)
22739 } else {
22740 Bytes::new(__input)
22741 };
22742 let mut __struct = Self::default();
22743 __struct.param_count = buf.get_u16_le();
22744 __struct.param_index = buf.get_u16_le();
22745 for v in &mut __struct.param_id {
22746 let val = buf.get_u8();
22747 *v = val;
22748 }
22749 for v in &mut __struct.param_value {
22750 let val = buf.get_u8();
22751 *v = val;
22752 }
22753 let tmp = buf.get_u8();
22754 __struct.param_type =
22755 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22756 enum_type: "MavParamExtType",
22757 value: tmp as u32,
22758 })?;
22759 Ok(__struct)
22760 }
22761 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22762 let mut __tmp = BytesMut::new(bytes);
22763 #[allow(clippy::absurd_extreme_comparisons)]
22764 #[allow(unused_comparisons)]
22765 if __tmp.remaining() < Self::ENCODED_LEN {
22766 panic!(
22767 "buffer is too small (need {} bytes, but got {})",
22768 Self::ENCODED_LEN,
22769 __tmp.remaining(),
22770 )
22771 }
22772 __tmp.put_u16_le(self.param_count);
22773 __tmp.put_u16_le(self.param_index);
22774 for val in &self.param_id {
22775 __tmp.put_u8(*val);
22776 }
22777 for val in &self.param_value {
22778 __tmp.put_u8(*val);
22779 }
22780 __tmp.put_u8(self.param_type as u8);
22781 if matches!(version, MavlinkVersion::V2) {
22782 let len = __tmp.len();
22783 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22784 } else {
22785 __tmp.len()
22786 }
22787 }
22788}
22789#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
22790#[doc = ""]
22791#[doc = "ID: 50"]
22792#[derive(Debug, Clone, PartialEq)]
22793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22795pub struct PARAM_MAP_RC_DATA {
22796 #[doc = "Initial parameter value"]
22797 pub param_value0: f32,
22798 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
22799 pub scale: f32,
22800 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
22801 pub param_value_min: f32,
22802 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
22803 pub param_value_max: f32,
22804 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
22805 pub param_index: i16,
22806 #[doc = "System ID"]
22807 pub target_system: u8,
22808 #[doc = "Component ID"]
22809 pub target_component: u8,
22810 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22811 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22812 pub param_id: [u8; 16],
22813 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
22814 pub parameter_rc_channel_index: u8,
22815}
22816impl PARAM_MAP_RC_DATA {
22817 pub const ENCODED_LEN: usize = 37usize;
22818 pub const DEFAULT: Self = Self {
22819 param_value0: 0.0_f32,
22820 scale: 0.0_f32,
22821 param_value_min: 0.0_f32,
22822 param_value_max: 0.0_f32,
22823 param_index: 0_i16,
22824 target_system: 0_u8,
22825 target_component: 0_u8,
22826 param_id: [0_u8; 16usize],
22827 parameter_rc_channel_index: 0_u8,
22828 };
22829 #[cfg(feature = "arbitrary")]
22830 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22831 use arbitrary::{Arbitrary, Unstructured};
22832 let mut buf = [0u8; 1024];
22833 rng.fill_bytes(&mut buf);
22834 let mut unstructured = Unstructured::new(&buf);
22835 Self::arbitrary(&mut unstructured).unwrap_or_default()
22836 }
22837}
22838impl Default for PARAM_MAP_RC_DATA {
22839 fn default() -> Self {
22840 Self::DEFAULT.clone()
22841 }
22842}
22843impl MessageData for PARAM_MAP_RC_DATA {
22844 type Message = MavMessage;
22845 const ID: u32 = 50u32;
22846 const NAME: &'static str = "PARAM_MAP_RC";
22847 const EXTRA_CRC: u8 = 78u8;
22848 const ENCODED_LEN: usize = 37usize;
22849 fn deser(
22850 _version: MavlinkVersion,
22851 __input: &[u8],
22852 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22853 let avail_len = __input.len();
22854 let mut payload_buf = [0; Self::ENCODED_LEN];
22855 let mut buf = if avail_len < Self::ENCODED_LEN {
22856 payload_buf[0..avail_len].copy_from_slice(__input);
22857 Bytes::new(&payload_buf)
22858 } else {
22859 Bytes::new(__input)
22860 };
22861 let mut __struct = Self::default();
22862 __struct.param_value0 = buf.get_f32_le();
22863 __struct.scale = buf.get_f32_le();
22864 __struct.param_value_min = buf.get_f32_le();
22865 __struct.param_value_max = buf.get_f32_le();
22866 __struct.param_index = buf.get_i16_le();
22867 __struct.target_system = buf.get_u8();
22868 __struct.target_component = buf.get_u8();
22869 for v in &mut __struct.param_id {
22870 let val = buf.get_u8();
22871 *v = val;
22872 }
22873 __struct.parameter_rc_channel_index = buf.get_u8();
22874 Ok(__struct)
22875 }
22876 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22877 let mut __tmp = BytesMut::new(bytes);
22878 #[allow(clippy::absurd_extreme_comparisons)]
22879 #[allow(unused_comparisons)]
22880 if __tmp.remaining() < Self::ENCODED_LEN {
22881 panic!(
22882 "buffer is too small (need {} bytes, but got {})",
22883 Self::ENCODED_LEN,
22884 __tmp.remaining(),
22885 )
22886 }
22887 __tmp.put_f32_le(self.param_value0);
22888 __tmp.put_f32_le(self.scale);
22889 __tmp.put_f32_le(self.param_value_min);
22890 __tmp.put_f32_le(self.param_value_max);
22891 __tmp.put_i16_le(self.param_index);
22892 __tmp.put_u8(self.target_system);
22893 __tmp.put_u8(self.target_component);
22894 for val in &self.param_id {
22895 __tmp.put_u8(*val);
22896 }
22897 __tmp.put_u8(self.parameter_rc_channel_index);
22898 if matches!(version, MavlinkVersion::V2) {
22899 let len = __tmp.len();
22900 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22901 } else {
22902 __tmp.len()
22903 }
22904 }
22905}
22906#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
22907#[doc = ""]
22908#[doc = "ID: 21"]
22909#[derive(Debug, Clone, PartialEq)]
22910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22912pub struct PARAM_REQUEST_LIST_DATA {
22913 #[doc = "System ID"]
22914 pub target_system: u8,
22915 #[doc = "Component ID"]
22916 pub target_component: u8,
22917}
22918impl PARAM_REQUEST_LIST_DATA {
22919 pub const ENCODED_LEN: usize = 2usize;
22920 pub const DEFAULT: Self = Self {
22921 target_system: 0_u8,
22922 target_component: 0_u8,
22923 };
22924 #[cfg(feature = "arbitrary")]
22925 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22926 use arbitrary::{Arbitrary, Unstructured};
22927 let mut buf = [0u8; 1024];
22928 rng.fill_bytes(&mut buf);
22929 let mut unstructured = Unstructured::new(&buf);
22930 Self::arbitrary(&mut unstructured).unwrap_or_default()
22931 }
22932}
22933impl Default for PARAM_REQUEST_LIST_DATA {
22934 fn default() -> Self {
22935 Self::DEFAULT.clone()
22936 }
22937}
22938impl MessageData for PARAM_REQUEST_LIST_DATA {
22939 type Message = MavMessage;
22940 const ID: u32 = 21u32;
22941 const NAME: &'static str = "PARAM_REQUEST_LIST";
22942 const EXTRA_CRC: u8 = 159u8;
22943 const ENCODED_LEN: usize = 2usize;
22944 fn deser(
22945 _version: MavlinkVersion,
22946 __input: &[u8],
22947 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22948 let avail_len = __input.len();
22949 let mut payload_buf = [0; Self::ENCODED_LEN];
22950 let mut buf = if avail_len < Self::ENCODED_LEN {
22951 payload_buf[0..avail_len].copy_from_slice(__input);
22952 Bytes::new(&payload_buf)
22953 } else {
22954 Bytes::new(__input)
22955 };
22956 let mut __struct = Self::default();
22957 __struct.target_system = buf.get_u8();
22958 __struct.target_component = buf.get_u8();
22959 Ok(__struct)
22960 }
22961 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22962 let mut __tmp = BytesMut::new(bytes);
22963 #[allow(clippy::absurd_extreme_comparisons)]
22964 #[allow(unused_comparisons)]
22965 if __tmp.remaining() < Self::ENCODED_LEN {
22966 panic!(
22967 "buffer is too small (need {} bytes, but got {})",
22968 Self::ENCODED_LEN,
22969 __tmp.remaining(),
22970 )
22971 }
22972 __tmp.put_u8(self.target_system);
22973 __tmp.put_u8(self.target_component);
22974 if matches!(version, MavlinkVersion::V2) {
22975 let len = __tmp.len();
22976 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22977 } else {
22978 __tmp.len()
22979 }
22980 }
22981}
22982#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
22983#[doc = ""]
22984#[doc = "ID: 20"]
22985#[derive(Debug, Clone, PartialEq)]
22986#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22987#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22988pub struct PARAM_REQUEST_READ_DATA {
22989 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
22990 pub param_index: i16,
22991 #[doc = "System ID"]
22992 pub target_system: u8,
22993 #[doc = "Component ID"]
22994 pub target_component: u8,
22995 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22996 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22997 pub param_id: [u8; 16],
22998}
22999impl PARAM_REQUEST_READ_DATA {
23000 pub const ENCODED_LEN: usize = 20usize;
23001 pub const DEFAULT: Self = Self {
23002 param_index: 0_i16,
23003 target_system: 0_u8,
23004 target_component: 0_u8,
23005 param_id: [0_u8; 16usize],
23006 };
23007 #[cfg(feature = "arbitrary")]
23008 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23009 use arbitrary::{Arbitrary, Unstructured};
23010 let mut buf = [0u8; 1024];
23011 rng.fill_bytes(&mut buf);
23012 let mut unstructured = Unstructured::new(&buf);
23013 Self::arbitrary(&mut unstructured).unwrap_or_default()
23014 }
23015}
23016impl Default for PARAM_REQUEST_READ_DATA {
23017 fn default() -> Self {
23018 Self::DEFAULT.clone()
23019 }
23020}
23021impl MessageData for PARAM_REQUEST_READ_DATA {
23022 type Message = MavMessage;
23023 const ID: u32 = 20u32;
23024 const NAME: &'static str = "PARAM_REQUEST_READ";
23025 const EXTRA_CRC: u8 = 214u8;
23026 const ENCODED_LEN: usize = 20usize;
23027 fn deser(
23028 _version: MavlinkVersion,
23029 __input: &[u8],
23030 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23031 let avail_len = __input.len();
23032 let mut payload_buf = [0; Self::ENCODED_LEN];
23033 let mut buf = if avail_len < Self::ENCODED_LEN {
23034 payload_buf[0..avail_len].copy_from_slice(__input);
23035 Bytes::new(&payload_buf)
23036 } else {
23037 Bytes::new(__input)
23038 };
23039 let mut __struct = Self::default();
23040 __struct.param_index = buf.get_i16_le();
23041 __struct.target_system = buf.get_u8();
23042 __struct.target_component = buf.get_u8();
23043 for v in &mut __struct.param_id {
23044 let val = buf.get_u8();
23045 *v = val;
23046 }
23047 Ok(__struct)
23048 }
23049 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23050 let mut __tmp = BytesMut::new(bytes);
23051 #[allow(clippy::absurd_extreme_comparisons)]
23052 #[allow(unused_comparisons)]
23053 if __tmp.remaining() < Self::ENCODED_LEN {
23054 panic!(
23055 "buffer is too small (need {} bytes, but got {})",
23056 Self::ENCODED_LEN,
23057 __tmp.remaining(),
23058 )
23059 }
23060 __tmp.put_i16_le(self.param_index);
23061 __tmp.put_u8(self.target_system);
23062 __tmp.put_u8(self.target_component);
23063 for val in &self.param_id {
23064 __tmp.put_u8(*val);
23065 }
23066 if matches!(version, MavlinkVersion::V2) {
23067 let len = __tmp.len();
23068 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23069 } else {
23070 __tmp.len()
23071 }
23072 }
23073}
23074#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23075#[doc = ""]
23076#[doc = "ID: 23"]
23077#[derive(Debug, Clone, PartialEq)]
23078#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23080pub struct PARAM_SET_DATA {
23081 #[doc = "Onboard parameter value"]
23082 pub param_value: f32,
23083 #[doc = "System ID"]
23084 pub target_system: u8,
23085 #[doc = "Component ID"]
23086 pub target_component: u8,
23087 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23088 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23089 pub param_id: [u8; 16],
23090 #[doc = "Onboard parameter type."]
23091 pub param_type: MavParamType,
23092}
23093impl PARAM_SET_DATA {
23094 pub const ENCODED_LEN: usize = 23usize;
23095 pub const DEFAULT: Self = Self {
23096 param_value: 0.0_f32,
23097 target_system: 0_u8,
23098 target_component: 0_u8,
23099 param_id: [0_u8; 16usize],
23100 param_type: MavParamType::DEFAULT,
23101 };
23102 #[cfg(feature = "arbitrary")]
23103 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23104 use arbitrary::{Arbitrary, Unstructured};
23105 let mut buf = [0u8; 1024];
23106 rng.fill_bytes(&mut buf);
23107 let mut unstructured = Unstructured::new(&buf);
23108 Self::arbitrary(&mut unstructured).unwrap_or_default()
23109 }
23110}
23111impl Default for PARAM_SET_DATA {
23112 fn default() -> Self {
23113 Self::DEFAULT.clone()
23114 }
23115}
23116impl MessageData for PARAM_SET_DATA {
23117 type Message = MavMessage;
23118 const ID: u32 = 23u32;
23119 const NAME: &'static str = "PARAM_SET";
23120 const EXTRA_CRC: u8 = 168u8;
23121 const ENCODED_LEN: usize = 23usize;
23122 fn deser(
23123 _version: MavlinkVersion,
23124 __input: &[u8],
23125 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23126 let avail_len = __input.len();
23127 let mut payload_buf = [0; Self::ENCODED_LEN];
23128 let mut buf = if avail_len < Self::ENCODED_LEN {
23129 payload_buf[0..avail_len].copy_from_slice(__input);
23130 Bytes::new(&payload_buf)
23131 } else {
23132 Bytes::new(__input)
23133 };
23134 let mut __struct = Self::default();
23135 __struct.param_value = buf.get_f32_le();
23136 __struct.target_system = buf.get_u8();
23137 __struct.target_component = buf.get_u8();
23138 for v in &mut __struct.param_id {
23139 let val = buf.get_u8();
23140 *v = val;
23141 }
23142 let tmp = buf.get_u8();
23143 __struct.param_type =
23144 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23145 enum_type: "MavParamType",
23146 value: tmp as u32,
23147 })?;
23148 Ok(__struct)
23149 }
23150 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23151 let mut __tmp = BytesMut::new(bytes);
23152 #[allow(clippy::absurd_extreme_comparisons)]
23153 #[allow(unused_comparisons)]
23154 if __tmp.remaining() < Self::ENCODED_LEN {
23155 panic!(
23156 "buffer is too small (need {} bytes, but got {})",
23157 Self::ENCODED_LEN,
23158 __tmp.remaining(),
23159 )
23160 }
23161 __tmp.put_f32_le(self.param_value);
23162 __tmp.put_u8(self.target_system);
23163 __tmp.put_u8(self.target_component);
23164 for val in &self.param_id {
23165 __tmp.put_u8(*val);
23166 }
23167 __tmp.put_u8(self.param_type as u8);
23168 if matches!(version, MavlinkVersion::V2) {
23169 let len = __tmp.len();
23170 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23171 } else {
23172 __tmp.len()
23173 }
23174 }
23175}
23176#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23177#[doc = ""]
23178#[doc = "ID: 22"]
23179#[derive(Debug, Clone, PartialEq)]
23180#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23182pub struct PARAM_VALUE_DATA {
23183 #[doc = "Onboard parameter value"]
23184 pub param_value: f32,
23185 #[doc = "Total number of onboard parameters"]
23186 pub param_count: u16,
23187 #[doc = "Index of this onboard parameter"]
23188 pub param_index: u16,
23189 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23190 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23191 pub param_id: [u8; 16],
23192 #[doc = "Onboard parameter type."]
23193 pub param_type: MavParamType,
23194}
23195impl PARAM_VALUE_DATA {
23196 pub const ENCODED_LEN: usize = 25usize;
23197 pub const DEFAULT: Self = Self {
23198 param_value: 0.0_f32,
23199 param_count: 0_u16,
23200 param_index: 0_u16,
23201 param_id: [0_u8; 16usize],
23202 param_type: MavParamType::DEFAULT,
23203 };
23204 #[cfg(feature = "arbitrary")]
23205 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23206 use arbitrary::{Arbitrary, Unstructured};
23207 let mut buf = [0u8; 1024];
23208 rng.fill_bytes(&mut buf);
23209 let mut unstructured = Unstructured::new(&buf);
23210 Self::arbitrary(&mut unstructured).unwrap_or_default()
23211 }
23212}
23213impl Default for PARAM_VALUE_DATA {
23214 fn default() -> Self {
23215 Self::DEFAULT.clone()
23216 }
23217}
23218impl MessageData for PARAM_VALUE_DATA {
23219 type Message = MavMessage;
23220 const ID: u32 = 22u32;
23221 const NAME: &'static str = "PARAM_VALUE";
23222 const EXTRA_CRC: u8 = 220u8;
23223 const ENCODED_LEN: usize = 25usize;
23224 fn deser(
23225 _version: MavlinkVersion,
23226 __input: &[u8],
23227 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23228 let avail_len = __input.len();
23229 let mut payload_buf = [0; Self::ENCODED_LEN];
23230 let mut buf = if avail_len < Self::ENCODED_LEN {
23231 payload_buf[0..avail_len].copy_from_slice(__input);
23232 Bytes::new(&payload_buf)
23233 } else {
23234 Bytes::new(__input)
23235 };
23236 let mut __struct = Self::default();
23237 __struct.param_value = buf.get_f32_le();
23238 __struct.param_count = buf.get_u16_le();
23239 __struct.param_index = buf.get_u16_le();
23240 for v in &mut __struct.param_id {
23241 let val = buf.get_u8();
23242 *v = val;
23243 }
23244 let tmp = buf.get_u8();
23245 __struct.param_type =
23246 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23247 enum_type: "MavParamType",
23248 value: tmp as u32,
23249 })?;
23250 Ok(__struct)
23251 }
23252 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23253 let mut __tmp = BytesMut::new(bytes);
23254 #[allow(clippy::absurd_extreme_comparisons)]
23255 #[allow(unused_comparisons)]
23256 if __tmp.remaining() < Self::ENCODED_LEN {
23257 panic!(
23258 "buffer is too small (need {} bytes, but got {})",
23259 Self::ENCODED_LEN,
23260 __tmp.remaining(),
23261 )
23262 }
23263 __tmp.put_f32_le(self.param_value);
23264 __tmp.put_u16_le(self.param_count);
23265 __tmp.put_u16_le(self.param_index);
23266 for val in &self.param_id {
23267 __tmp.put_u8(*val);
23268 }
23269 __tmp.put_u8(self.param_type as u8);
23270 if matches!(version, MavlinkVersion::V2) {
23271 let len = __tmp.len();
23272 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23273 } else {
23274 __tmp.len()
23275 }
23276 }
23277}
23278#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
23279#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
23280#[doc = ""]
23281#[doc = "ID: 4"]
23282#[derive(Debug, Clone, PartialEq)]
23283#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23284#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23285pub struct PING_DATA {
23286 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23287 pub time_usec: u64,
23288 #[doc = "PING sequence"]
23289 pub seq: u32,
23290 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
23291 pub target_system: u8,
23292 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
23293 pub target_component: u8,
23294}
23295impl PING_DATA {
23296 pub const ENCODED_LEN: usize = 14usize;
23297 pub const DEFAULT: Self = Self {
23298 time_usec: 0_u64,
23299 seq: 0_u32,
23300 target_system: 0_u8,
23301 target_component: 0_u8,
23302 };
23303 #[cfg(feature = "arbitrary")]
23304 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23305 use arbitrary::{Arbitrary, Unstructured};
23306 let mut buf = [0u8; 1024];
23307 rng.fill_bytes(&mut buf);
23308 let mut unstructured = Unstructured::new(&buf);
23309 Self::arbitrary(&mut unstructured).unwrap_or_default()
23310 }
23311}
23312impl Default for PING_DATA {
23313 fn default() -> Self {
23314 Self::DEFAULT.clone()
23315 }
23316}
23317impl MessageData for PING_DATA {
23318 type Message = MavMessage;
23319 const ID: u32 = 4u32;
23320 const NAME: &'static str = "PING";
23321 const EXTRA_CRC: u8 = 237u8;
23322 const ENCODED_LEN: usize = 14usize;
23323 fn deser(
23324 _version: MavlinkVersion,
23325 __input: &[u8],
23326 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23327 let avail_len = __input.len();
23328 let mut payload_buf = [0; Self::ENCODED_LEN];
23329 let mut buf = if avail_len < Self::ENCODED_LEN {
23330 payload_buf[0..avail_len].copy_from_slice(__input);
23331 Bytes::new(&payload_buf)
23332 } else {
23333 Bytes::new(__input)
23334 };
23335 let mut __struct = Self::default();
23336 __struct.time_usec = buf.get_u64_le();
23337 __struct.seq = buf.get_u32_le();
23338 __struct.target_system = buf.get_u8();
23339 __struct.target_component = buf.get_u8();
23340 Ok(__struct)
23341 }
23342 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23343 let mut __tmp = BytesMut::new(bytes);
23344 #[allow(clippy::absurd_extreme_comparisons)]
23345 #[allow(unused_comparisons)]
23346 if __tmp.remaining() < Self::ENCODED_LEN {
23347 panic!(
23348 "buffer is too small (need {} bytes, but got {})",
23349 Self::ENCODED_LEN,
23350 __tmp.remaining(),
23351 )
23352 }
23353 __tmp.put_u64_le(self.time_usec);
23354 __tmp.put_u32_le(self.seq);
23355 __tmp.put_u8(self.target_system);
23356 __tmp.put_u8(self.target_component);
23357 if matches!(version, MavlinkVersion::V2) {
23358 let len = __tmp.len();
23359 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23360 } else {
23361 __tmp.len()
23362 }
23363 }
23364}
23365#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
23366#[doc = "Control vehicle tone generation (buzzer)."]
23367#[doc = ""]
23368#[doc = "ID: 258"]
23369#[derive(Debug, Clone, PartialEq)]
23370#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23371#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23372pub struct PLAY_TUNE_DATA {
23373 #[doc = "System ID"]
23374 pub target_system: u8,
23375 #[doc = "Component ID"]
23376 pub target_component: u8,
23377 #[doc = "tune in board specific format"]
23378 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23379 pub tune: [u8; 30],
23380 #[doc = "tune extension (appended to tune)"]
23381 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23382 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23383 pub tune2: [u8; 200],
23384}
23385impl PLAY_TUNE_DATA {
23386 pub const ENCODED_LEN: usize = 232usize;
23387 pub const DEFAULT: Self = Self {
23388 target_system: 0_u8,
23389 target_component: 0_u8,
23390 tune: [0_u8; 30usize],
23391 tune2: [0_u8; 200usize],
23392 };
23393 #[cfg(feature = "arbitrary")]
23394 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23395 use arbitrary::{Arbitrary, Unstructured};
23396 let mut buf = [0u8; 1024];
23397 rng.fill_bytes(&mut buf);
23398 let mut unstructured = Unstructured::new(&buf);
23399 Self::arbitrary(&mut unstructured).unwrap_or_default()
23400 }
23401}
23402impl Default for PLAY_TUNE_DATA {
23403 fn default() -> Self {
23404 Self::DEFAULT.clone()
23405 }
23406}
23407impl MessageData for PLAY_TUNE_DATA {
23408 type Message = MavMessage;
23409 const ID: u32 = 258u32;
23410 const NAME: &'static str = "PLAY_TUNE";
23411 const EXTRA_CRC: u8 = 187u8;
23412 const ENCODED_LEN: usize = 232usize;
23413 fn deser(
23414 _version: MavlinkVersion,
23415 __input: &[u8],
23416 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23417 let avail_len = __input.len();
23418 let mut payload_buf = [0; Self::ENCODED_LEN];
23419 let mut buf = if avail_len < Self::ENCODED_LEN {
23420 payload_buf[0..avail_len].copy_from_slice(__input);
23421 Bytes::new(&payload_buf)
23422 } else {
23423 Bytes::new(__input)
23424 };
23425 let mut __struct = Self::default();
23426 __struct.target_system = buf.get_u8();
23427 __struct.target_component = buf.get_u8();
23428 for v in &mut __struct.tune {
23429 let val = buf.get_u8();
23430 *v = val;
23431 }
23432 for v in &mut __struct.tune2 {
23433 let val = buf.get_u8();
23434 *v = val;
23435 }
23436 Ok(__struct)
23437 }
23438 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23439 let mut __tmp = BytesMut::new(bytes);
23440 #[allow(clippy::absurd_extreme_comparisons)]
23441 #[allow(unused_comparisons)]
23442 if __tmp.remaining() < Self::ENCODED_LEN {
23443 panic!(
23444 "buffer is too small (need {} bytes, but got {})",
23445 Self::ENCODED_LEN,
23446 __tmp.remaining(),
23447 )
23448 }
23449 __tmp.put_u8(self.target_system);
23450 __tmp.put_u8(self.target_component);
23451 for val in &self.tune {
23452 __tmp.put_u8(*val);
23453 }
23454 if matches!(version, MavlinkVersion::V2) {
23455 for val in &self.tune2 {
23456 __tmp.put_u8(*val);
23457 }
23458 let len = __tmp.len();
23459 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23460 } else {
23461 __tmp.len()
23462 }
23463 }
23464}
23465#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
23466#[doc = ""]
23467#[doc = "ID: 400"]
23468#[derive(Debug, Clone, PartialEq)]
23469#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23470#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23471pub struct PLAY_TUNE_V2_DATA {
23472 #[doc = "Tune format"]
23473 pub format: TuneFormat,
23474 #[doc = "System ID"]
23475 pub target_system: u8,
23476 #[doc = "Component ID"]
23477 pub target_component: u8,
23478 #[doc = "Tune definition as a NULL-terminated string."]
23479 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23480 pub tune: [u8; 248],
23481}
23482impl PLAY_TUNE_V2_DATA {
23483 pub const ENCODED_LEN: usize = 254usize;
23484 pub const DEFAULT: Self = Self {
23485 format: TuneFormat::DEFAULT,
23486 target_system: 0_u8,
23487 target_component: 0_u8,
23488 tune: [0_u8; 248usize],
23489 };
23490 #[cfg(feature = "arbitrary")]
23491 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23492 use arbitrary::{Arbitrary, Unstructured};
23493 let mut buf = [0u8; 1024];
23494 rng.fill_bytes(&mut buf);
23495 let mut unstructured = Unstructured::new(&buf);
23496 Self::arbitrary(&mut unstructured).unwrap_or_default()
23497 }
23498}
23499impl Default for PLAY_TUNE_V2_DATA {
23500 fn default() -> Self {
23501 Self::DEFAULT.clone()
23502 }
23503}
23504impl MessageData for PLAY_TUNE_V2_DATA {
23505 type Message = MavMessage;
23506 const ID: u32 = 400u32;
23507 const NAME: &'static str = "PLAY_TUNE_V2";
23508 const EXTRA_CRC: u8 = 110u8;
23509 const ENCODED_LEN: usize = 254usize;
23510 fn deser(
23511 _version: MavlinkVersion,
23512 __input: &[u8],
23513 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23514 let avail_len = __input.len();
23515 let mut payload_buf = [0; Self::ENCODED_LEN];
23516 let mut buf = if avail_len < Self::ENCODED_LEN {
23517 payload_buf[0..avail_len].copy_from_slice(__input);
23518 Bytes::new(&payload_buf)
23519 } else {
23520 Bytes::new(__input)
23521 };
23522 let mut __struct = Self::default();
23523 let tmp = buf.get_u32_le();
23524 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
23525 ::mavlink_core::error::ParserError::InvalidEnum {
23526 enum_type: "TuneFormat",
23527 value: tmp as u32,
23528 },
23529 )?;
23530 __struct.target_system = buf.get_u8();
23531 __struct.target_component = buf.get_u8();
23532 for v in &mut __struct.tune {
23533 let val = buf.get_u8();
23534 *v = val;
23535 }
23536 Ok(__struct)
23537 }
23538 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23539 let mut __tmp = BytesMut::new(bytes);
23540 #[allow(clippy::absurd_extreme_comparisons)]
23541 #[allow(unused_comparisons)]
23542 if __tmp.remaining() < Self::ENCODED_LEN {
23543 panic!(
23544 "buffer is too small (need {} bytes, but got {})",
23545 Self::ENCODED_LEN,
23546 __tmp.remaining(),
23547 )
23548 }
23549 __tmp.put_u32_le(self.format as u32);
23550 __tmp.put_u8(self.target_system);
23551 __tmp.put_u8(self.target_component);
23552 for val in &self.tune {
23553 __tmp.put_u8(*val);
23554 }
23555 if matches!(version, MavlinkVersion::V2) {
23556 let len = __tmp.len();
23557 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23558 } else {
23559 __tmp.len()
23560 }
23561 }
23562}
23563#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
23564#[doc = ""]
23565#[doc = "ID: 87"]
23566#[derive(Debug, Clone, PartialEq)]
23567#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23568#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23569pub struct POSITION_TARGET_GLOBAL_INT_DATA {
23570 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
23571 pub time_boot_ms: u32,
23572 #[doc = "Latitude in WGS84 frame"]
23573 pub lat_int: i32,
23574 #[doc = "Longitude in WGS84 frame"]
23575 pub lon_int: i32,
23576 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
23577 pub alt: f32,
23578 #[doc = "X velocity in NED frame"]
23579 pub vx: f32,
23580 #[doc = "Y velocity in NED frame"]
23581 pub vy: f32,
23582 #[doc = "Z velocity in NED frame"]
23583 pub vz: f32,
23584 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23585 pub afx: f32,
23586 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23587 pub afy: f32,
23588 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23589 pub afz: f32,
23590 #[doc = "yaw setpoint"]
23591 pub yaw: f32,
23592 #[doc = "yaw rate setpoint"]
23593 pub yaw_rate: f32,
23594 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
23595 pub type_mask: PositionTargetTypemask,
23596 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
23597 pub coordinate_frame: MavFrame,
23598}
23599impl POSITION_TARGET_GLOBAL_INT_DATA {
23600 pub const ENCODED_LEN: usize = 51usize;
23601 pub const DEFAULT: Self = Self {
23602 time_boot_ms: 0_u32,
23603 lat_int: 0_i32,
23604 lon_int: 0_i32,
23605 alt: 0.0_f32,
23606 vx: 0.0_f32,
23607 vy: 0.0_f32,
23608 vz: 0.0_f32,
23609 afx: 0.0_f32,
23610 afy: 0.0_f32,
23611 afz: 0.0_f32,
23612 yaw: 0.0_f32,
23613 yaw_rate: 0.0_f32,
23614 type_mask: PositionTargetTypemask::DEFAULT,
23615 coordinate_frame: MavFrame::DEFAULT,
23616 };
23617 #[cfg(feature = "arbitrary")]
23618 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23619 use arbitrary::{Arbitrary, Unstructured};
23620 let mut buf = [0u8; 1024];
23621 rng.fill_bytes(&mut buf);
23622 let mut unstructured = Unstructured::new(&buf);
23623 Self::arbitrary(&mut unstructured).unwrap_or_default()
23624 }
23625}
23626impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
23627 fn default() -> Self {
23628 Self::DEFAULT.clone()
23629 }
23630}
23631impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
23632 type Message = MavMessage;
23633 const ID: u32 = 87u32;
23634 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
23635 const EXTRA_CRC: u8 = 150u8;
23636 const ENCODED_LEN: usize = 51usize;
23637 fn deser(
23638 _version: MavlinkVersion,
23639 __input: &[u8],
23640 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23641 let avail_len = __input.len();
23642 let mut payload_buf = [0; Self::ENCODED_LEN];
23643 let mut buf = if avail_len < Self::ENCODED_LEN {
23644 payload_buf[0..avail_len].copy_from_slice(__input);
23645 Bytes::new(&payload_buf)
23646 } else {
23647 Bytes::new(__input)
23648 };
23649 let mut __struct = Self::default();
23650 __struct.time_boot_ms = buf.get_u32_le();
23651 __struct.lat_int = buf.get_i32_le();
23652 __struct.lon_int = buf.get_i32_le();
23653 __struct.alt = buf.get_f32_le();
23654 __struct.vx = buf.get_f32_le();
23655 __struct.vy = buf.get_f32_le();
23656 __struct.vz = buf.get_f32_le();
23657 __struct.afx = buf.get_f32_le();
23658 __struct.afy = buf.get_f32_le();
23659 __struct.afz = buf.get_f32_le();
23660 __struct.yaw = buf.get_f32_le();
23661 __struct.yaw_rate = buf.get_f32_le();
23662 let tmp = buf.get_u16_le();
23663 __struct.type_mask = PositionTargetTypemask::from_bits(
23664 tmp & PositionTargetTypemask::all().bits(),
23665 )
23666 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23667 flag_type: "PositionTargetTypemask",
23668 value: tmp as u32,
23669 })?;
23670 let tmp = buf.get_u8();
23671 __struct.coordinate_frame =
23672 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23673 enum_type: "MavFrame",
23674 value: tmp as u32,
23675 })?;
23676 Ok(__struct)
23677 }
23678 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23679 let mut __tmp = BytesMut::new(bytes);
23680 #[allow(clippy::absurd_extreme_comparisons)]
23681 #[allow(unused_comparisons)]
23682 if __tmp.remaining() < Self::ENCODED_LEN {
23683 panic!(
23684 "buffer is too small (need {} bytes, but got {})",
23685 Self::ENCODED_LEN,
23686 __tmp.remaining(),
23687 )
23688 }
23689 __tmp.put_u32_le(self.time_boot_ms);
23690 __tmp.put_i32_le(self.lat_int);
23691 __tmp.put_i32_le(self.lon_int);
23692 __tmp.put_f32_le(self.alt);
23693 __tmp.put_f32_le(self.vx);
23694 __tmp.put_f32_le(self.vy);
23695 __tmp.put_f32_le(self.vz);
23696 __tmp.put_f32_le(self.afx);
23697 __tmp.put_f32_le(self.afy);
23698 __tmp.put_f32_le(self.afz);
23699 __tmp.put_f32_le(self.yaw);
23700 __tmp.put_f32_le(self.yaw_rate);
23701 __tmp.put_u16_le(self.type_mask.bits());
23702 __tmp.put_u8(self.coordinate_frame as u8);
23703 if matches!(version, MavlinkVersion::V2) {
23704 let len = __tmp.len();
23705 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23706 } else {
23707 __tmp.len()
23708 }
23709 }
23710}
23711#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
23712#[doc = ""]
23713#[doc = "ID: 85"]
23714#[derive(Debug, Clone, PartialEq)]
23715#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23717pub struct POSITION_TARGET_LOCAL_NED_DATA {
23718 #[doc = "Timestamp (time since system boot)."]
23719 pub time_boot_ms: u32,
23720 #[doc = "X Position in NED frame"]
23721 pub x: f32,
23722 #[doc = "Y Position in NED frame"]
23723 pub y: f32,
23724 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
23725 pub z: f32,
23726 #[doc = "X velocity in NED frame"]
23727 pub vx: f32,
23728 #[doc = "Y velocity in NED frame"]
23729 pub vy: f32,
23730 #[doc = "Z velocity in NED frame"]
23731 pub vz: f32,
23732 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23733 pub afx: f32,
23734 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23735 pub afy: f32,
23736 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23737 pub afz: f32,
23738 #[doc = "yaw setpoint"]
23739 pub yaw: f32,
23740 #[doc = "yaw rate setpoint"]
23741 pub yaw_rate: f32,
23742 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
23743 pub type_mask: PositionTargetTypemask,
23744 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
23745 pub coordinate_frame: MavFrame,
23746}
23747impl POSITION_TARGET_LOCAL_NED_DATA {
23748 pub const ENCODED_LEN: usize = 51usize;
23749 pub const DEFAULT: Self = Self {
23750 time_boot_ms: 0_u32,
23751 x: 0.0_f32,
23752 y: 0.0_f32,
23753 z: 0.0_f32,
23754 vx: 0.0_f32,
23755 vy: 0.0_f32,
23756 vz: 0.0_f32,
23757 afx: 0.0_f32,
23758 afy: 0.0_f32,
23759 afz: 0.0_f32,
23760 yaw: 0.0_f32,
23761 yaw_rate: 0.0_f32,
23762 type_mask: PositionTargetTypemask::DEFAULT,
23763 coordinate_frame: MavFrame::DEFAULT,
23764 };
23765 #[cfg(feature = "arbitrary")]
23766 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23767 use arbitrary::{Arbitrary, Unstructured};
23768 let mut buf = [0u8; 1024];
23769 rng.fill_bytes(&mut buf);
23770 let mut unstructured = Unstructured::new(&buf);
23771 Self::arbitrary(&mut unstructured).unwrap_or_default()
23772 }
23773}
23774impl Default for POSITION_TARGET_LOCAL_NED_DATA {
23775 fn default() -> Self {
23776 Self::DEFAULT.clone()
23777 }
23778}
23779impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
23780 type Message = MavMessage;
23781 const ID: u32 = 85u32;
23782 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
23783 const EXTRA_CRC: u8 = 140u8;
23784 const ENCODED_LEN: usize = 51usize;
23785 fn deser(
23786 _version: MavlinkVersion,
23787 __input: &[u8],
23788 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23789 let avail_len = __input.len();
23790 let mut payload_buf = [0; Self::ENCODED_LEN];
23791 let mut buf = if avail_len < Self::ENCODED_LEN {
23792 payload_buf[0..avail_len].copy_from_slice(__input);
23793 Bytes::new(&payload_buf)
23794 } else {
23795 Bytes::new(__input)
23796 };
23797 let mut __struct = Self::default();
23798 __struct.time_boot_ms = buf.get_u32_le();
23799 __struct.x = buf.get_f32_le();
23800 __struct.y = buf.get_f32_le();
23801 __struct.z = buf.get_f32_le();
23802 __struct.vx = buf.get_f32_le();
23803 __struct.vy = buf.get_f32_le();
23804 __struct.vz = buf.get_f32_le();
23805 __struct.afx = buf.get_f32_le();
23806 __struct.afy = buf.get_f32_le();
23807 __struct.afz = buf.get_f32_le();
23808 __struct.yaw = buf.get_f32_le();
23809 __struct.yaw_rate = buf.get_f32_le();
23810 let tmp = buf.get_u16_le();
23811 __struct.type_mask = PositionTargetTypemask::from_bits(
23812 tmp & PositionTargetTypemask::all().bits(),
23813 )
23814 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23815 flag_type: "PositionTargetTypemask",
23816 value: tmp as u32,
23817 })?;
23818 let tmp = buf.get_u8();
23819 __struct.coordinate_frame =
23820 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23821 enum_type: "MavFrame",
23822 value: tmp as u32,
23823 })?;
23824 Ok(__struct)
23825 }
23826 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23827 let mut __tmp = BytesMut::new(bytes);
23828 #[allow(clippy::absurd_extreme_comparisons)]
23829 #[allow(unused_comparisons)]
23830 if __tmp.remaining() < Self::ENCODED_LEN {
23831 panic!(
23832 "buffer is too small (need {} bytes, but got {})",
23833 Self::ENCODED_LEN,
23834 __tmp.remaining(),
23835 )
23836 }
23837 __tmp.put_u32_le(self.time_boot_ms);
23838 __tmp.put_f32_le(self.x);
23839 __tmp.put_f32_le(self.y);
23840 __tmp.put_f32_le(self.z);
23841 __tmp.put_f32_le(self.vx);
23842 __tmp.put_f32_le(self.vy);
23843 __tmp.put_f32_le(self.vz);
23844 __tmp.put_f32_le(self.afx);
23845 __tmp.put_f32_le(self.afy);
23846 __tmp.put_f32_le(self.afz);
23847 __tmp.put_f32_le(self.yaw);
23848 __tmp.put_f32_le(self.yaw_rate);
23849 __tmp.put_u16_le(self.type_mask.bits());
23850 __tmp.put_u8(self.coordinate_frame as u8);
23851 if matches!(version, MavlinkVersion::V2) {
23852 let len = __tmp.len();
23853 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23854 } else {
23855 __tmp.len()
23856 }
23857 }
23858}
23859#[doc = "Power supply status."]
23860#[doc = ""]
23861#[doc = "ID: 125"]
23862#[derive(Debug, Clone, PartialEq)]
23863#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23864#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23865pub struct POWER_STATUS_DATA {
23866 #[doc = "5V rail voltage."]
23867 pub Vcc: u16,
23868 #[doc = "Servo rail voltage."]
23869 pub Vservo: u16,
23870 #[doc = "Bitmap of power supply status flags."]
23871 pub flags: MavPowerStatus,
23872}
23873impl POWER_STATUS_DATA {
23874 pub const ENCODED_LEN: usize = 6usize;
23875 pub const DEFAULT: Self = Self {
23876 Vcc: 0_u16,
23877 Vservo: 0_u16,
23878 flags: MavPowerStatus::DEFAULT,
23879 };
23880 #[cfg(feature = "arbitrary")]
23881 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23882 use arbitrary::{Arbitrary, Unstructured};
23883 let mut buf = [0u8; 1024];
23884 rng.fill_bytes(&mut buf);
23885 let mut unstructured = Unstructured::new(&buf);
23886 Self::arbitrary(&mut unstructured).unwrap_or_default()
23887 }
23888}
23889impl Default for POWER_STATUS_DATA {
23890 fn default() -> Self {
23891 Self::DEFAULT.clone()
23892 }
23893}
23894impl MessageData for POWER_STATUS_DATA {
23895 type Message = MavMessage;
23896 const ID: u32 = 125u32;
23897 const NAME: &'static str = "POWER_STATUS";
23898 const EXTRA_CRC: u8 = 203u8;
23899 const ENCODED_LEN: usize = 6usize;
23900 fn deser(
23901 _version: MavlinkVersion,
23902 __input: &[u8],
23903 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23904 let avail_len = __input.len();
23905 let mut payload_buf = [0; Self::ENCODED_LEN];
23906 let mut buf = if avail_len < Self::ENCODED_LEN {
23907 payload_buf[0..avail_len].copy_from_slice(__input);
23908 Bytes::new(&payload_buf)
23909 } else {
23910 Bytes::new(__input)
23911 };
23912 let mut __struct = Self::default();
23913 __struct.Vcc = buf.get_u16_le();
23914 __struct.Vservo = buf.get_u16_le();
23915 let tmp = buf.get_u16_le();
23916 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
23917 ::mavlink_core::error::ParserError::InvalidFlag {
23918 flag_type: "MavPowerStatus",
23919 value: tmp as u32,
23920 },
23921 )?;
23922 Ok(__struct)
23923 }
23924 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23925 let mut __tmp = BytesMut::new(bytes);
23926 #[allow(clippy::absurd_extreme_comparisons)]
23927 #[allow(unused_comparisons)]
23928 if __tmp.remaining() < Self::ENCODED_LEN {
23929 panic!(
23930 "buffer is too small (need {} bytes, but got {})",
23931 Self::ENCODED_LEN,
23932 __tmp.remaining(),
23933 )
23934 }
23935 __tmp.put_u16_le(self.Vcc);
23936 __tmp.put_u16_le(self.Vservo);
23937 __tmp.put_u16_le(self.flags.bits());
23938 if matches!(version, MavlinkVersion::V2) {
23939 let len = __tmp.len();
23940 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23941 } else {
23942 __tmp.len()
23943 }
23944 }
23945}
23946#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
23947#[doc = ""]
23948#[doc = "ID: 300"]
23949#[derive(Debug, Clone, PartialEq)]
23950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23952pub struct PROTOCOL_VERSION_DATA {
23953 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
23954 pub version: u16,
23955 #[doc = "Minimum MAVLink version supported"]
23956 pub min_version: u16,
23957 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
23958 pub max_version: u16,
23959 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
23960 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23961 pub spec_version_hash: [u8; 8],
23962 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
23963 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23964 pub library_version_hash: [u8; 8],
23965}
23966impl PROTOCOL_VERSION_DATA {
23967 pub const ENCODED_LEN: usize = 22usize;
23968 pub const DEFAULT: Self = Self {
23969 version: 0_u16,
23970 min_version: 0_u16,
23971 max_version: 0_u16,
23972 spec_version_hash: [0_u8; 8usize],
23973 library_version_hash: [0_u8; 8usize],
23974 };
23975 #[cfg(feature = "arbitrary")]
23976 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23977 use arbitrary::{Arbitrary, Unstructured};
23978 let mut buf = [0u8; 1024];
23979 rng.fill_bytes(&mut buf);
23980 let mut unstructured = Unstructured::new(&buf);
23981 Self::arbitrary(&mut unstructured).unwrap_or_default()
23982 }
23983}
23984impl Default for PROTOCOL_VERSION_DATA {
23985 fn default() -> Self {
23986 Self::DEFAULT.clone()
23987 }
23988}
23989impl MessageData for PROTOCOL_VERSION_DATA {
23990 type Message = MavMessage;
23991 const ID: u32 = 300u32;
23992 const NAME: &'static str = "PROTOCOL_VERSION";
23993 const EXTRA_CRC: u8 = 217u8;
23994 const ENCODED_LEN: usize = 22usize;
23995 fn deser(
23996 _version: MavlinkVersion,
23997 __input: &[u8],
23998 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23999 let avail_len = __input.len();
24000 let mut payload_buf = [0; Self::ENCODED_LEN];
24001 let mut buf = if avail_len < Self::ENCODED_LEN {
24002 payload_buf[0..avail_len].copy_from_slice(__input);
24003 Bytes::new(&payload_buf)
24004 } else {
24005 Bytes::new(__input)
24006 };
24007 let mut __struct = Self::default();
24008 __struct.version = buf.get_u16_le();
24009 __struct.min_version = buf.get_u16_le();
24010 __struct.max_version = buf.get_u16_le();
24011 for v in &mut __struct.spec_version_hash {
24012 let val = buf.get_u8();
24013 *v = val;
24014 }
24015 for v in &mut __struct.library_version_hash {
24016 let val = buf.get_u8();
24017 *v = val;
24018 }
24019 Ok(__struct)
24020 }
24021 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24022 let mut __tmp = BytesMut::new(bytes);
24023 #[allow(clippy::absurd_extreme_comparisons)]
24024 #[allow(unused_comparisons)]
24025 if __tmp.remaining() < Self::ENCODED_LEN {
24026 panic!(
24027 "buffer is too small (need {} bytes, but got {})",
24028 Self::ENCODED_LEN,
24029 __tmp.remaining(),
24030 )
24031 }
24032 __tmp.put_u16_le(self.version);
24033 __tmp.put_u16_le(self.min_version);
24034 __tmp.put_u16_le(self.max_version);
24035 for val in &self.spec_version_hash {
24036 __tmp.put_u8(*val);
24037 }
24038 for val in &self.library_version_hash {
24039 __tmp.put_u8(*val);
24040 }
24041 if matches!(version, MavlinkVersion::V2) {
24042 let len = __tmp.len();
24043 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24044 } else {
24045 __tmp.len()
24046 }
24047 }
24048}
24049#[doc = "Status generated by radio and injected into MAVLink stream."]
24050#[doc = ""]
24051#[doc = "ID: 109"]
24052#[derive(Debug, Clone, PartialEq)]
24053#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24054#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24055pub struct RADIO_STATUS_DATA {
24056 #[doc = "Count of radio packet receive errors (since boot)."]
24057 pub rxerrors: u16,
24058 #[doc = "Count of error corrected radio packets (since boot)."]
24059 pub fixed: u16,
24060 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24061 pub rssi: u8,
24062 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24063 pub remrssi: u8,
24064 #[doc = "Remaining free transmitter buffer space."]
24065 pub txbuf: u8,
24066 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24067 pub noise: u8,
24068 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24069 pub remnoise: u8,
24070}
24071impl RADIO_STATUS_DATA {
24072 pub const ENCODED_LEN: usize = 9usize;
24073 pub const DEFAULT: Self = Self {
24074 rxerrors: 0_u16,
24075 fixed: 0_u16,
24076 rssi: 0_u8,
24077 remrssi: 0_u8,
24078 txbuf: 0_u8,
24079 noise: 0_u8,
24080 remnoise: 0_u8,
24081 };
24082 #[cfg(feature = "arbitrary")]
24083 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24084 use arbitrary::{Arbitrary, Unstructured};
24085 let mut buf = [0u8; 1024];
24086 rng.fill_bytes(&mut buf);
24087 let mut unstructured = Unstructured::new(&buf);
24088 Self::arbitrary(&mut unstructured).unwrap_or_default()
24089 }
24090}
24091impl Default for RADIO_STATUS_DATA {
24092 fn default() -> Self {
24093 Self::DEFAULT.clone()
24094 }
24095}
24096impl MessageData for RADIO_STATUS_DATA {
24097 type Message = MavMessage;
24098 const ID: u32 = 109u32;
24099 const NAME: &'static str = "RADIO_STATUS";
24100 const EXTRA_CRC: u8 = 185u8;
24101 const ENCODED_LEN: usize = 9usize;
24102 fn deser(
24103 _version: MavlinkVersion,
24104 __input: &[u8],
24105 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24106 let avail_len = __input.len();
24107 let mut payload_buf = [0; Self::ENCODED_LEN];
24108 let mut buf = if avail_len < Self::ENCODED_LEN {
24109 payload_buf[0..avail_len].copy_from_slice(__input);
24110 Bytes::new(&payload_buf)
24111 } else {
24112 Bytes::new(__input)
24113 };
24114 let mut __struct = Self::default();
24115 __struct.rxerrors = buf.get_u16_le();
24116 __struct.fixed = buf.get_u16_le();
24117 __struct.rssi = buf.get_u8();
24118 __struct.remrssi = buf.get_u8();
24119 __struct.txbuf = buf.get_u8();
24120 __struct.noise = buf.get_u8();
24121 __struct.remnoise = buf.get_u8();
24122 Ok(__struct)
24123 }
24124 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24125 let mut __tmp = BytesMut::new(bytes);
24126 #[allow(clippy::absurd_extreme_comparisons)]
24127 #[allow(unused_comparisons)]
24128 if __tmp.remaining() < Self::ENCODED_LEN {
24129 panic!(
24130 "buffer is too small (need {} bytes, but got {})",
24131 Self::ENCODED_LEN,
24132 __tmp.remaining(),
24133 )
24134 }
24135 __tmp.put_u16_le(self.rxerrors);
24136 __tmp.put_u16_le(self.fixed);
24137 __tmp.put_u8(self.rssi);
24138 __tmp.put_u8(self.remrssi);
24139 __tmp.put_u8(self.txbuf);
24140 __tmp.put_u8(self.noise);
24141 __tmp.put_u8(self.remnoise);
24142 if matches!(version, MavlinkVersion::V2) {
24143 let len = __tmp.len();
24144 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24145 } else {
24146 __tmp.len()
24147 }
24148 }
24149}
24150#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
24151#[doc = ""]
24152#[doc = "ID: 27"]
24153#[derive(Debug, Clone, PartialEq)]
24154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24155#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24156pub struct RAW_IMU_DATA {
24157 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24158 pub time_usec: u64,
24159 #[doc = "X acceleration (raw)"]
24160 pub xacc: i16,
24161 #[doc = "Y acceleration (raw)"]
24162 pub yacc: i16,
24163 #[doc = "Z acceleration (raw)"]
24164 pub zacc: i16,
24165 #[doc = "Angular speed around X axis (raw)"]
24166 pub xgyro: i16,
24167 #[doc = "Angular speed around Y axis (raw)"]
24168 pub ygyro: i16,
24169 #[doc = "Angular speed around Z axis (raw)"]
24170 pub zgyro: i16,
24171 #[doc = "X Magnetic field (raw)"]
24172 pub xmag: i16,
24173 #[doc = "Y Magnetic field (raw)"]
24174 pub ymag: i16,
24175 #[doc = "Z Magnetic field (raw)"]
24176 pub zmag: i16,
24177 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
24178 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24179 pub id: u8,
24180 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
24181 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24182 pub temperature: i16,
24183}
24184impl RAW_IMU_DATA {
24185 pub const ENCODED_LEN: usize = 29usize;
24186 pub const DEFAULT: Self = Self {
24187 time_usec: 0_u64,
24188 xacc: 0_i16,
24189 yacc: 0_i16,
24190 zacc: 0_i16,
24191 xgyro: 0_i16,
24192 ygyro: 0_i16,
24193 zgyro: 0_i16,
24194 xmag: 0_i16,
24195 ymag: 0_i16,
24196 zmag: 0_i16,
24197 id: 0_u8,
24198 temperature: 0_i16,
24199 };
24200 #[cfg(feature = "arbitrary")]
24201 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24202 use arbitrary::{Arbitrary, Unstructured};
24203 let mut buf = [0u8; 1024];
24204 rng.fill_bytes(&mut buf);
24205 let mut unstructured = Unstructured::new(&buf);
24206 Self::arbitrary(&mut unstructured).unwrap_or_default()
24207 }
24208}
24209impl Default for RAW_IMU_DATA {
24210 fn default() -> Self {
24211 Self::DEFAULT.clone()
24212 }
24213}
24214impl MessageData for RAW_IMU_DATA {
24215 type Message = MavMessage;
24216 const ID: u32 = 27u32;
24217 const NAME: &'static str = "RAW_IMU";
24218 const EXTRA_CRC: u8 = 144u8;
24219 const ENCODED_LEN: usize = 29usize;
24220 fn deser(
24221 _version: MavlinkVersion,
24222 __input: &[u8],
24223 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24224 let avail_len = __input.len();
24225 let mut payload_buf = [0; Self::ENCODED_LEN];
24226 let mut buf = if avail_len < Self::ENCODED_LEN {
24227 payload_buf[0..avail_len].copy_from_slice(__input);
24228 Bytes::new(&payload_buf)
24229 } else {
24230 Bytes::new(__input)
24231 };
24232 let mut __struct = Self::default();
24233 __struct.time_usec = buf.get_u64_le();
24234 __struct.xacc = buf.get_i16_le();
24235 __struct.yacc = buf.get_i16_le();
24236 __struct.zacc = buf.get_i16_le();
24237 __struct.xgyro = buf.get_i16_le();
24238 __struct.ygyro = buf.get_i16_le();
24239 __struct.zgyro = buf.get_i16_le();
24240 __struct.xmag = buf.get_i16_le();
24241 __struct.ymag = buf.get_i16_le();
24242 __struct.zmag = buf.get_i16_le();
24243 __struct.id = buf.get_u8();
24244 __struct.temperature = buf.get_i16_le();
24245 Ok(__struct)
24246 }
24247 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24248 let mut __tmp = BytesMut::new(bytes);
24249 #[allow(clippy::absurd_extreme_comparisons)]
24250 #[allow(unused_comparisons)]
24251 if __tmp.remaining() < Self::ENCODED_LEN {
24252 panic!(
24253 "buffer is too small (need {} bytes, but got {})",
24254 Self::ENCODED_LEN,
24255 __tmp.remaining(),
24256 )
24257 }
24258 __tmp.put_u64_le(self.time_usec);
24259 __tmp.put_i16_le(self.xacc);
24260 __tmp.put_i16_le(self.yacc);
24261 __tmp.put_i16_le(self.zacc);
24262 __tmp.put_i16_le(self.xgyro);
24263 __tmp.put_i16_le(self.ygyro);
24264 __tmp.put_i16_le(self.zgyro);
24265 __tmp.put_i16_le(self.xmag);
24266 __tmp.put_i16_le(self.ymag);
24267 __tmp.put_i16_le(self.zmag);
24268 if matches!(version, MavlinkVersion::V2) {
24269 __tmp.put_u8(self.id);
24270 __tmp.put_i16_le(self.temperature);
24271 let len = __tmp.len();
24272 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24273 } else {
24274 __tmp.len()
24275 }
24276 }
24277}
24278#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
24279#[doc = ""]
24280#[doc = "ID: 28"]
24281#[derive(Debug, Clone, PartialEq)]
24282#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24283#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24284pub struct RAW_PRESSURE_DATA {
24285 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24286 pub time_usec: u64,
24287 #[doc = "Absolute pressure (raw)"]
24288 pub press_abs: i16,
24289 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
24290 pub press_diff1: i16,
24291 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
24292 pub press_diff2: i16,
24293 #[doc = "Raw Temperature measurement (raw)"]
24294 pub temperature: i16,
24295}
24296impl RAW_PRESSURE_DATA {
24297 pub const ENCODED_LEN: usize = 16usize;
24298 pub const DEFAULT: Self = Self {
24299 time_usec: 0_u64,
24300 press_abs: 0_i16,
24301 press_diff1: 0_i16,
24302 press_diff2: 0_i16,
24303 temperature: 0_i16,
24304 };
24305 #[cfg(feature = "arbitrary")]
24306 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24307 use arbitrary::{Arbitrary, Unstructured};
24308 let mut buf = [0u8; 1024];
24309 rng.fill_bytes(&mut buf);
24310 let mut unstructured = Unstructured::new(&buf);
24311 Self::arbitrary(&mut unstructured).unwrap_or_default()
24312 }
24313}
24314impl Default for RAW_PRESSURE_DATA {
24315 fn default() -> Self {
24316 Self::DEFAULT.clone()
24317 }
24318}
24319impl MessageData for RAW_PRESSURE_DATA {
24320 type Message = MavMessage;
24321 const ID: u32 = 28u32;
24322 const NAME: &'static str = "RAW_PRESSURE";
24323 const EXTRA_CRC: u8 = 67u8;
24324 const ENCODED_LEN: usize = 16usize;
24325 fn deser(
24326 _version: MavlinkVersion,
24327 __input: &[u8],
24328 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24329 let avail_len = __input.len();
24330 let mut payload_buf = [0; Self::ENCODED_LEN];
24331 let mut buf = if avail_len < Self::ENCODED_LEN {
24332 payload_buf[0..avail_len].copy_from_slice(__input);
24333 Bytes::new(&payload_buf)
24334 } else {
24335 Bytes::new(__input)
24336 };
24337 let mut __struct = Self::default();
24338 __struct.time_usec = buf.get_u64_le();
24339 __struct.press_abs = buf.get_i16_le();
24340 __struct.press_diff1 = buf.get_i16_le();
24341 __struct.press_diff2 = buf.get_i16_le();
24342 __struct.temperature = buf.get_i16_le();
24343 Ok(__struct)
24344 }
24345 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24346 let mut __tmp = BytesMut::new(bytes);
24347 #[allow(clippy::absurd_extreme_comparisons)]
24348 #[allow(unused_comparisons)]
24349 if __tmp.remaining() < Self::ENCODED_LEN {
24350 panic!(
24351 "buffer is too small (need {} bytes, but got {})",
24352 Self::ENCODED_LEN,
24353 __tmp.remaining(),
24354 )
24355 }
24356 __tmp.put_u64_le(self.time_usec);
24357 __tmp.put_i16_le(self.press_abs);
24358 __tmp.put_i16_le(self.press_diff1);
24359 __tmp.put_i16_le(self.press_diff2);
24360 __tmp.put_i16_le(self.temperature);
24361 if matches!(version, MavlinkVersion::V2) {
24362 let len = __tmp.len();
24363 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24364 } else {
24365 __tmp.len()
24366 }
24367 }
24368}
24369#[doc = "RPM sensor data message."]
24370#[doc = ""]
24371#[doc = "ID: 339"]
24372#[derive(Debug, Clone, PartialEq)]
24373#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24374#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24375pub struct RAW_RPM_DATA {
24376 #[doc = "Indicated rate"]
24377 pub frequency: f32,
24378 #[doc = "Index of this RPM sensor (0-indexed)"]
24379 pub index: u8,
24380}
24381impl RAW_RPM_DATA {
24382 pub const ENCODED_LEN: usize = 5usize;
24383 pub const DEFAULT: Self = Self {
24384 frequency: 0.0_f32,
24385 index: 0_u8,
24386 };
24387 #[cfg(feature = "arbitrary")]
24388 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24389 use arbitrary::{Arbitrary, Unstructured};
24390 let mut buf = [0u8; 1024];
24391 rng.fill_bytes(&mut buf);
24392 let mut unstructured = Unstructured::new(&buf);
24393 Self::arbitrary(&mut unstructured).unwrap_or_default()
24394 }
24395}
24396impl Default for RAW_RPM_DATA {
24397 fn default() -> Self {
24398 Self::DEFAULT.clone()
24399 }
24400}
24401impl MessageData for RAW_RPM_DATA {
24402 type Message = MavMessage;
24403 const ID: u32 = 339u32;
24404 const NAME: &'static str = "RAW_RPM";
24405 const EXTRA_CRC: u8 = 199u8;
24406 const ENCODED_LEN: usize = 5usize;
24407 fn deser(
24408 _version: MavlinkVersion,
24409 __input: &[u8],
24410 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24411 let avail_len = __input.len();
24412 let mut payload_buf = [0; Self::ENCODED_LEN];
24413 let mut buf = if avail_len < Self::ENCODED_LEN {
24414 payload_buf[0..avail_len].copy_from_slice(__input);
24415 Bytes::new(&payload_buf)
24416 } else {
24417 Bytes::new(__input)
24418 };
24419 let mut __struct = Self::default();
24420 __struct.frequency = buf.get_f32_le();
24421 __struct.index = buf.get_u8();
24422 Ok(__struct)
24423 }
24424 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24425 let mut __tmp = BytesMut::new(bytes);
24426 #[allow(clippy::absurd_extreme_comparisons)]
24427 #[allow(unused_comparisons)]
24428 if __tmp.remaining() < Self::ENCODED_LEN {
24429 panic!(
24430 "buffer is too small (need {} bytes, but got {})",
24431 Self::ENCODED_LEN,
24432 __tmp.remaining(),
24433 )
24434 }
24435 __tmp.put_f32_le(self.frequency);
24436 __tmp.put_u8(self.index);
24437 if matches!(version, MavlinkVersion::V2) {
24438 let len = __tmp.len();
24439 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24440 } else {
24441 __tmp.len()
24442 }
24443 }
24444}
24445#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
24446#[doc = ""]
24447#[doc = "ID: 65"]
24448#[derive(Debug, Clone, PartialEq)]
24449#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24450#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24451pub struct RC_CHANNELS_DATA {
24452 #[doc = "Timestamp (time since system boot)."]
24453 pub time_boot_ms: u32,
24454 #[doc = "RC channel 1 value."]
24455 pub chan1_raw: u16,
24456 #[doc = "RC channel 2 value."]
24457 pub chan2_raw: u16,
24458 #[doc = "RC channel 3 value."]
24459 pub chan3_raw: u16,
24460 #[doc = "RC channel 4 value."]
24461 pub chan4_raw: u16,
24462 #[doc = "RC channel 5 value."]
24463 pub chan5_raw: u16,
24464 #[doc = "RC channel 6 value."]
24465 pub chan6_raw: u16,
24466 #[doc = "RC channel 7 value."]
24467 pub chan7_raw: u16,
24468 #[doc = "RC channel 8 value."]
24469 pub chan8_raw: u16,
24470 #[doc = "RC channel 9 value."]
24471 pub chan9_raw: u16,
24472 #[doc = "RC channel 10 value."]
24473 pub chan10_raw: u16,
24474 #[doc = "RC channel 11 value."]
24475 pub chan11_raw: u16,
24476 #[doc = "RC channel 12 value."]
24477 pub chan12_raw: u16,
24478 #[doc = "RC channel 13 value."]
24479 pub chan13_raw: u16,
24480 #[doc = "RC channel 14 value."]
24481 pub chan14_raw: u16,
24482 #[doc = "RC channel 15 value."]
24483 pub chan15_raw: u16,
24484 #[doc = "RC channel 16 value."]
24485 pub chan16_raw: u16,
24486 #[doc = "RC channel 17 value."]
24487 pub chan17_raw: u16,
24488 #[doc = "RC channel 18 value."]
24489 pub chan18_raw: u16,
24490 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
24491 pub chancount: u8,
24492 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24493 pub rssi: u8,
24494}
24495impl RC_CHANNELS_DATA {
24496 pub const ENCODED_LEN: usize = 42usize;
24497 pub const DEFAULT: Self = Self {
24498 time_boot_ms: 0_u32,
24499 chan1_raw: 0_u16,
24500 chan2_raw: 0_u16,
24501 chan3_raw: 0_u16,
24502 chan4_raw: 0_u16,
24503 chan5_raw: 0_u16,
24504 chan6_raw: 0_u16,
24505 chan7_raw: 0_u16,
24506 chan8_raw: 0_u16,
24507 chan9_raw: 0_u16,
24508 chan10_raw: 0_u16,
24509 chan11_raw: 0_u16,
24510 chan12_raw: 0_u16,
24511 chan13_raw: 0_u16,
24512 chan14_raw: 0_u16,
24513 chan15_raw: 0_u16,
24514 chan16_raw: 0_u16,
24515 chan17_raw: 0_u16,
24516 chan18_raw: 0_u16,
24517 chancount: 0_u8,
24518 rssi: 0_u8,
24519 };
24520 #[cfg(feature = "arbitrary")]
24521 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24522 use arbitrary::{Arbitrary, Unstructured};
24523 let mut buf = [0u8; 1024];
24524 rng.fill_bytes(&mut buf);
24525 let mut unstructured = Unstructured::new(&buf);
24526 Self::arbitrary(&mut unstructured).unwrap_or_default()
24527 }
24528}
24529impl Default for RC_CHANNELS_DATA {
24530 fn default() -> Self {
24531 Self::DEFAULT.clone()
24532 }
24533}
24534impl MessageData for RC_CHANNELS_DATA {
24535 type Message = MavMessage;
24536 const ID: u32 = 65u32;
24537 const NAME: &'static str = "RC_CHANNELS";
24538 const EXTRA_CRC: u8 = 118u8;
24539 const ENCODED_LEN: usize = 42usize;
24540 fn deser(
24541 _version: MavlinkVersion,
24542 __input: &[u8],
24543 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24544 let avail_len = __input.len();
24545 let mut payload_buf = [0; Self::ENCODED_LEN];
24546 let mut buf = if avail_len < Self::ENCODED_LEN {
24547 payload_buf[0..avail_len].copy_from_slice(__input);
24548 Bytes::new(&payload_buf)
24549 } else {
24550 Bytes::new(__input)
24551 };
24552 let mut __struct = Self::default();
24553 __struct.time_boot_ms = buf.get_u32_le();
24554 __struct.chan1_raw = buf.get_u16_le();
24555 __struct.chan2_raw = buf.get_u16_le();
24556 __struct.chan3_raw = buf.get_u16_le();
24557 __struct.chan4_raw = buf.get_u16_le();
24558 __struct.chan5_raw = buf.get_u16_le();
24559 __struct.chan6_raw = buf.get_u16_le();
24560 __struct.chan7_raw = buf.get_u16_le();
24561 __struct.chan8_raw = buf.get_u16_le();
24562 __struct.chan9_raw = buf.get_u16_le();
24563 __struct.chan10_raw = buf.get_u16_le();
24564 __struct.chan11_raw = buf.get_u16_le();
24565 __struct.chan12_raw = buf.get_u16_le();
24566 __struct.chan13_raw = buf.get_u16_le();
24567 __struct.chan14_raw = buf.get_u16_le();
24568 __struct.chan15_raw = buf.get_u16_le();
24569 __struct.chan16_raw = buf.get_u16_le();
24570 __struct.chan17_raw = buf.get_u16_le();
24571 __struct.chan18_raw = buf.get_u16_le();
24572 __struct.chancount = buf.get_u8();
24573 __struct.rssi = buf.get_u8();
24574 Ok(__struct)
24575 }
24576 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24577 let mut __tmp = BytesMut::new(bytes);
24578 #[allow(clippy::absurd_extreme_comparisons)]
24579 #[allow(unused_comparisons)]
24580 if __tmp.remaining() < Self::ENCODED_LEN {
24581 panic!(
24582 "buffer is too small (need {} bytes, but got {})",
24583 Self::ENCODED_LEN,
24584 __tmp.remaining(),
24585 )
24586 }
24587 __tmp.put_u32_le(self.time_boot_ms);
24588 __tmp.put_u16_le(self.chan1_raw);
24589 __tmp.put_u16_le(self.chan2_raw);
24590 __tmp.put_u16_le(self.chan3_raw);
24591 __tmp.put_u16_le(self.chan4_raw);
24592 __tmp.put_u16_le(self.chan5_raw);
24593 __tmp.put_u16_le(self.chan6_raw);
24594 __tmp.put_u16_le(self.chan7_raw);
24595 __tmp.put_u16_le(self.chan8_raw);
24596 __tmp.put_u16_le(self.chan9_raw);
24597 __tmp.put_u16_le(self.chan10_raw);
24598 __tmp.put_u16_le(self.chan11_raw);
24599 __tmp.put_u16_le(self.chan12_raw);
24600 __tmp.put_u16_le(self.chan13_raw);
24601 __tmp.put_u16_le(self.chan14_raw);
24602 __tmp.put_u16_le(self.chan15_raw);
24603 __tmp.put_u16_le(self.chan16_raw);
24604 __tmp.put_u16_le(self.chan17_raw);
24605 __tmp.put_u16_le(self.chan18_raw);
24606 __tmp.put_u8(self.chancount);
24607 __tmp.put_u8(self.rssi);
24608 if matches!(version, MavlinkVersion::V2) {
24609 let len = __tmp.len();
24610 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24611 } else {
24612 __tmp.len()
24613 }
24614 }
24615}
24616#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
24617#[doc = ""]
24618#[doc = "ID: 70"]
24619#[derive(Debug, Clone, PartialEq)]
24620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24622pub struct RC_CHANNELS_OVERRIDE_DATA {
24623 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24624 pub chan1_raw: u16,
24625 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24626 pub chan2_raw: u16,
24627 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24628 pub chan3_raw: u16,
24629 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24630 pub chan4_raw: u16,
24631 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24632 pub chan5_raw: u16,
24633 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24634 pub chan6_raw: u16,
24635 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24636 pub chan7_raw: u16,
24637 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24638 pub chan8_raw: u16,
24639 #[doc = "System ID"]
24640 pub target_system: u8,
24641 #[doc = "Component ID"]
24642 pub target_component: u8,
24643 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24644 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24645 pub chan9_raw: u16,
24646 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24647 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24648 pub chan10_raw: u16,
24649 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24650 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24651 pub chan11_raw: u16,
24652 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24653 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24654 pub chan12_raw: u16,
24655 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24656 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24657 pub chan13_raw: u16,
24658 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24659 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24660 pub chan14_raw: u16,
24661 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24662 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24663 pub chan15_raw: u16,
24664 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24665 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24666 pub chan16_raw: u16,
24667 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24668 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24669 pub chan17_raw: u16,
24670 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24671 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24672 pub chan18_raw: u16,
24673}
24674impl RC_CHANNELS_OVERRIDE_DATA {
24675 pub const ENCODED_LEN: usize = 38usize;
24676 pub const DEFAULT: Self = Self {
24677 chan1_raw: 0_u16,
24678 chan2_raw: 0_u16,
24679 chan3_raw: 0_u16,
24680 chan4_raw: 0_u16,
24681 chan5_raw: 0_u16,
24682 chan6_raw: 0_u16,
24683 chan7_raw: 0_u16,
24684 chan8_raw: 0_u16,
24685 target_system: 0_u8,
24686 target_component: 0_u8,
24687 chan9_raw: 0_u16,
24688 chan10_raw: 0_u16,
24689 chan11_raw: 0_u16,
24690 chan12_raw: 0_u16,
24691 chan13_raw: 0_u16,
24692 chan14_raw: 0_u16,
24693 chan15_raw: 0_u16,
24694 chan16_raw: 0_u16,
24695 chan17_raw: 0_u16,
24696 chan18_raw: 0_u16,
24697 };
24698 #[cfg(feature = "arbitrary")]
24699 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24700 use arbitrary::{Arbitrary, Unstructured};
24701 let mut buf = [0u8; 1024];
24702 rng.fill_bytes(&mut buf);
24703 let mut unstructured = Unstructured::new(&buf);
24704 Self::arbitrary(&mut unstructured).unwrap_or_default()
24705 }
24706}
24707impl Default for RC_CHANNELS_OVERRIDE_DATA {
24708 fn default() -> Self {
24709 Self::DEFAULT.clone()
24710 }
24711}
24712impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
24713 type Message = MavMessage;
24714 const ID: u32 = 70u32;
24715 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
24716 const EXTRA_CRC: u8 = 124u8;
24717 const ENCODED_LEN: usize = 38usize;
24718 fn deser(
24719 _version: MavlinkVersion,
24720 __input: &[u8],
24721 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24722 let avail_len = __input.len();
24723 let mut payload_buf = [0; Self::ENCODED_LEN];
24724 let mut buf = if avail_len < Self::ENCODED_LEN {
24725 payload_buf[0..avail_len].copy_from_slice(__input);
24726 Bytes::new(&payload_buf)
24727 } else {
24728 Bytes::new(__input)
24729 };
24730 let mut __struct = Self::default();
24731 __struct.chan1_raw = buf.get_u16_le();
24732 __struct.chan2_raw = buf.get_u16_le();
24733 __struct.chan3_raw = buf.get_u16_le();
24734 __struct.chan4_raw = buf.get_u16_le();
24735 __struct.chan5_raw = buf.get_u16_le();
24736 __struct.chan6_raw = buf.get_u16_le();
24737 __struct.chan7_raw = buf.get_u16_le();
24738 __struct.chan8_raw = buf.get_u16_le();
24739 __struct.target_system = buf.get_u8();
24740 __struct.target_component = buf.get_u8();
24741 __struct.chan9_raw = buf.get_u16_le();
24742 __struct.chan10_raw = buf.get_u16_le();
24743 __struct.chan11_raw = buf.get_u16_le();
24744 __struct.chan12_raw = buf.get_u16_le();
24745 __struct.chan13_raw = buf.get_u16_le();
24746 __struct.chan14_raw = buf.get_u16_le();
24747 __struct.chan15_raw = buf.get_u16_le();
24748 __struct.chan16_raw = buf.get_u16_le();
24749 __struct.chan17_raw = buf.get_u16_le();
24750 __struct.chan18_raw = buf.get_u16_le();
24751 Ok(__struct)
24752 }
24753 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24754 let mut __tmp = BytesMut::new(bytes);
24755 #[allow(clippy::absurd_extreme_comparisons)]
24756 #[allow(unused_comparisons)]
24757 if __tmp.remaining() < Self::ENCODED_LEN {
24758 panic!(
24759 "buffer is too small (need {} bytes, but got {})",
24760 Self::ENCODED_LEN,
24761 __tmp.remaining(),
24762 )
24763 }
24764 __tmp.put_u16_le(self.chan1_raw);
24765 __tmp.put_u16_le(self.chan2_raw);
24766 __tmp.put_u16_le(self.chan3_raw);
24767 __tmp.put_u16_le(self.chan4_raw);
24768 __tmp.put_u16_le(self.chan5_raw);
24769 __tmp.put_u16_le(self.chan6_raw);
24770 __tmp.put_u16_le(self.chan7_raw);
24771 __tmp.put_u16_le(self.chan8_raw);
24772 __tmp.put_u8(self.target_system);
24773 __tmp.put_u8(self.target_component);
24774 if matches!(version, MavlinkVersion::V2) {
24775 __tmp.put_u16_le(self.chan9_raw);
24776 __tmp.put_u16_le(self.chan10_raw);
24777 __tmp.put_u16_le(self.chan11_raw);
24778 __tmp.put_u16_le(self.chan12_raw);
24779 __tmp.put_u16_le(self.chan13_raw);
24780 __tmp.put_u16_le(self.chan14_raw);
24781 __tmp.put_u16_le(self.chan15_raw);
24782 __tmp.put_u16_le(self.chan16_raw);
24783 __tmp.put_u16_le(self.chan17_raw);
24784 __tmp.put_u16_le(self.chan18_raw);
24785 let len = __tmp.len();
24786 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24787 } else {
24788 __tmp.len()
24789 }
24790 }
24791}
24792#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
24793#[doc = ""]
24794#[doc = "ID: 35"]
24795#[derive(Debug, Clone, PartialEq)]
24796#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24798pub struct RC_CHANNELS_RAW_DATA {
24799 #[doc = "Timestamp (time since system boot)."]
24800 pub time_boot_ms: u32,
24801 #[doc = "RC channel 1 value."]
24802 pub chan1_raw: u16,
24803 #[doc = "RC channel 2 value."]
24804 pub chan2_raw: u16,
24805 #[doc = "RC channel 3 value."]
24806 pub chan3_raw: u16,
24807 #[doc = "RC channel 4 value."]
24808 pub chan4_raw: u16,
24809 #[doc = "RC channel 5 value."]
24810 pub chan5_raw: u16,
24811 #[doc = "RC channel 6 value."]
24812 pub chan6_raw: u16,
24813 #[doc = "RC channel 7 value."]
24814 pub chan7_raw: u16,
24815 #[doc = "RC channel 8 value."]
24816 pub chan8_raw: u16,
24817 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
24818 pub port: u8,
24819 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24820 pub rssi: u8,
24821}
24822impl RC_CHANNELS_RAW_DATA {
24823 pub const ENCODED_LEN: usize = 22usize;
24824 pub const DEFAULT: Self = Self {
24825 time_boot_ms: 0_u32,
24826 chan1_raw: 0_u16,
24827 chan2_raw: 0_u16,
24828 chan3_raw: 0_u16,
24829 chan4_raw: 0_u16,
24830 chan5_raw: 0_u16,
24831 chan6_raw: 0_u16,
24832 chan7_raw: 0_u16,
24833 chan8_raw: 0_u16,
24834 port: 0_u8,
24835 rssi: 0_u8,
24836 };
24837 #[cfg(feature = "arbitrary")]
24838 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24839 use arbitrary::{Arbitrary, Unstructured};
24840 let mut buf = [0u8; 1024];
24841 rng.fill_bytes(&mut buf);
24842 let mut unstructured = Unstructured::new(&buf);
24843 Self::arbitrary(&mut unstructured).unwrap_or_default()
24844 }
24845}
24846impl Default for RC_CHANNELS_RAW_DATA {
24847 fn default() -> Self {
24848 Self::DEFAULT.clone()
24849 }
24850}
24851impl MessageData for RC_CHANNELS_RAW_DATA {
24852 type Message = MavMessage;
24853 const ID: u32 = 35u32;
24854 const NAME: &'static str = "RC_CHANNELS_RAW";
24855 const EXTRA_CRC: u8 = 244u8;
24856 const ENCODED_LEN: usize = 22usize;
24857 fn deser(
24858 _version: MavlinkVersion,
24859 __input: &[u8],
24860 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24861 let avail_len = __input.len();
24862 let mut payload_buf = [0; Self::ENCODED_LEN];
24863 let mut buf = if avail_len < Self::ENCODED_LEN {
24864 payload_buf[0..avail_len].copy_from_slice(__input);
24865 Bytes::new(&payload_buf)
24866 } else {
24867 Bytes::new(__input)
24868 };
24869 let mut __struct = Self::default();
24870 __struct.time_boot_ms = buf.get_u32_le();
24871 __struct.chan1_raw = buf.get_u16_le();
24872 __struct.chan2_raw = buf.get_u16_le();
24873 __struct.chan3_raw = buf.get_u16_le();
24874 __struct.chan4_raw = buf.get_u16_le();
24875 __struct.chan5_raw = buf.get_u16_le();
24876 __struct.chan6_raw = buf.get_u16_le();
24877 __struct.chan7_raw = buf.get_u16_le();
24878 __struct.chan8_raw = buf.get_u16_le();
24879 __struct.port = buf.get_u8();
24880 __struct.rssi = buf.get_u8();
24881 Ok(__struct)
24882 }
24883 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24884 let mut __tmp = BytesMut::new(bytes);
24885 #[allow(clippy::absurd_extreme_comparisons)]
24886 #[allow(unused_comparisons)]
24887 if __tmp.remaining() < Self::ENCODED_LEN {
24888 panic!(
24889 "buffer is too small (need {} bytes, but got {})",
24890 Self::ENCODED_LEN,
24891 __tmp.remaining(),
24892 )
24893 }
24894 __tmp.put_u32_le(self.time_boot_ms);
24895 __tmp.put_u16_le(self.chan1_raw);
24896 __tmp.put_u16_le(self.chan2_raw);
24897 __tmp.put_u16_le(self.chan3_raw);
24898 __tmp.put_u16_le(self.chan4_raw);
24899 __tmp.put_u16_le(self.chan5_raw);
24900 __tmp.put_u16_le(self.chan6_raw);
24901 __tmp.put_u16_le(self.chan7_raw);
24902 __tmp.put_u16_le(self.chan8_raw);
24903 __tmp.put_u8(self.port);
24904 __tmp.put_u8(self.rssi);
24905 if matches!(version, MavlinkVersion::V2) {
24906 let len = __tmp.len();
24907 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24908 } else {
24909 __tmp.len()
24910 }
24911 }
24912}
24913#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
24914#[doc = ""]
24915#[doc = "ID: 34"]
24916#[derive(Debug, Clone, PartialEq)]
24917#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24918#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24919pub struct RC_CHANNELS_SCALED_DATA {
24920 #[doc = "Timestamp (time since system boot)."]
24921 pub time_boot_ms: u32,
24922 #[doc = "RC channel 1 value scaled."]
24923 pub chan1_scaled: i16,
24924 #[doc = "RC channel 2 value scaled."]
24925 pub chan2_scaled: i16,
24926 #[doc = "RC channel 3 value scaled."]
24927 pub chan3_scaled: i16,
24928 #[doc = "RC channel 4 value scaled."]
24929 pub chan4_scaled: i16,
24930 #[doc = "RC channel 5 value scaled."]
24931 pub chan5_scaled: i16,
24932 #[doc = "RC channel 6 value scaled."]
24933 pub chan6_scaled: i16,
24934 #[doc = "RC channel 7 value scaled."]
24935 pub chan7_scaled: i16,
24936 #[doc = "RC channel 8 value scaled."]
24937 pub chan8_scaled: i16,
24938 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
24939 pub port: u8,
24940 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24941 pub rssi: u8,
24942}
24943impl RC_CHANNELS_SCALED_DATA {
24944 pub const ENCODED_LEN: usize = 22usize;
24945 pub const DEFAULT: Self = Self {
24946 time_boot_ms: 0_u32,
24947 chan1_scaled: 0_i16,
24948 chan2_scaled: 0_i16,
24949 chan3_scaled: 0_i16,
24950 chan4_scaled: 0_i16,
24951 chan5_scaled: 0_i16,
24952 chan6_scaled: 0_i16,
24953 chan7_scaled: 0_i16,
24954 chan8_scaled: 0_i16,
24955 port: 0_u8,
24956 rssi: 0_u8,
24957 };
24958 #[cfg(feature = "arbitrary")]
24959 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24960 use arbitrary::{Arbitrary, Unstructured};
24961 let mut buf = [0u8; 1024];
24962 rng.fill_bytes(&mut buf);
24963 let mut unstructured = Unstructured::new(&buf);
24964 Self::arbitrary(&mut unstructured).unwrap_or_default()
24965 }
24966}
24967impl Default for RC_CHANNELS_SCALED_DATA {
24968 fn default() -> Self {
24969 Self::DEFAULT.clone()
24970 }
24971}
24972impl MessageData for RC_CHANNELS_SCALED_DATA {
24973 type Message = MavMessage;
24974 const ID: u32 = 34u32;
24975 const NAME: &'static str = "RC_CHANNELS_SCALED";
24976 const EXTRA_CRC: u8 = 237u8;
24977 const ENCODED_LEN: usize = 22usize;
24978 fn deser(
24979 _version: MavlinkVersion,
24980 __input: &[u8],
24981 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24982 let avail_len = __input.len();
24983 let mut payload_buf = [0; Self::ENCODED_LEN];
24984 let mut buf = if avail_len < Self::ENCODED_LEN {
24985 payload_buf[0..avail_len].copy_from_slice(__input);
24986 Bytes::new(&payload_buf)
24987 } else {
24988 Bytes::new(__input)
24989 };
24990 let mut __struct = Self::default();
24991 __struct.time_boot_ms = buf.get_u32_le();
24992 __struct.chan1_scaled = buf.get_i16_le();
24993 __struct.chan2_scaled = buf.get_i16_le();
24994 __struct.chan3_scaled = buf.get_i16_le();
24995 __struct.chan4_scaled = buf.get_i16_le();
24996 __struct.chan5_scaled = buf.get_i16_le();
24997 __struct.chan6_scaled = buf.get_i16_le();
24998 __struct.chan7_scaled = buf.get_i16_le();
24999 __struct.chan8_scaled = buf.get_i16_le();
25000 __struct.port = buf.get_u8();
25001 __struct.rssi = buf.get_u8();
25002 Ok(__struct)
25003 }
25004 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25005 let mut __tmp = BytesMut::new(bytes);
25006 #[allow(clippy::absurd_extreme_comparisons)]
25007 #[allow(unused_comparisons)]
25008 if __tmp.remaining() < Self::ENCODED_LEN {
25009 panic!(
25010 "buffer is too small (need {} bytes, but got {})",
25011 Self::ENCODED_LEN,
25012 __tmp.remaining(),
25013 )
25014 }
25015 __tmp.put_u32_le(self.time_boot_ms);
25016 __tmp.put_i16_le(self.chan1_scaled);
25017 __tmp.put_i16_le(self.chan2_scaled);
25018 __tmp.put_i16_le(self.chan3_scaled);
25019 __tmp.put_i16_le(self.chan4_scaled);
25020 __tmp.put_i16_le(self.chan5_scaled);
25021 __tmp.put_i16_le(self.chan6_scaled);
25022 __tmp.put_i16_le(self.chan7_scaled);
25023 __tmp.put_i16_le(self.chan8_scaled);
25024 __tmp.put_u8(self.port);
25025 __tmp.put_u8(self.rssi);
25026 if matches!(version, MavlinkVersion::V2) {
25027 let len = __tmp.len();
25028 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25029 } else {
25030 __tmp.len()
25031 }
25032 }
25033}
25034#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
25035#[doc = "Request a data stream."]
25036#[doc = ""]
25037#[doc = "ID: 66"]
25038#[derive(Debug, Clone, PartialEq)]
25039#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25040#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25041pub struct REQUEST_DATA_STREAM_DATA {
25042 #[doc = "The requested message rate"]
25043 pub req_message_rate: u16,
25044 #[doc = "The target requested to send the message stream."]
25045 pub target_system: u8,
25046 #[doc = "The target requested to send the message stream."]
25047 pub target_component: u8,
25048 #[doc = "The ID of the requested data stream"]
25049 pub req_stream_id: u8,
25050 #[doc = "1 to start sending, 0 to stop sending."]
25051 pub start_stop: u8,
25052}
25053impl REQUEST_DATA_STREAM_DATA {
25054 pub const ENCODED_LEN: usize = 6usize;
25055 pub const DEFAULT: Self = Self {
25056 req_message_rate: 0_u16,
25057 target_system: 0_u8,
25058 target_component: 0_u8,
25059 req_stream_id: 0_u8,
25060 start_stop: 0_u8,
25061 };
25062 #[cfg(feature = "arbitrary")]
25063 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25064 use arbitrary::{Arbitrary, Unstructured};
25065 let mut buf = [0u8; 1024];
25066 rng.fill_bytes(&mut buf);
25067 let mut unstructured = Unstructured::new(&buf);
25068 Self::arbitrary(&mut unstructured).unwrap_or_default()
25069 }
25070}
25071impl Default for REQUEST_DATA_STREAM_DATA {
25072 fn default() -> Self {
25073 Self::DEFAULT.clone()
25074 }
25075}
25076impl MessageData for REQUEST_DATA_STREAM_DATA {
25077 type Message = MavMessage;
25078 const ID: u32 = 66u32;
25079 const NAME: &'static str = "REQUEST_DATA_STREAM";
25080 const EXTRA_CRC: u8 = 148u8;
25081 const ENCODED_LEN: usize = 6usize;
25082 fn deser(
25083 _version: MavlinkVersion,
25084 __input: &[u8],
25085 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25086 let avail_len = __input.len();
25087 let mut payload_buf = [0; Self::ENCODED_LEN];
25088 let mut buf = if avail_len < Self::ENCODED_LEN {
25089 payload_buf[0..avail_len].copy_from_slice(__input);
25090 Bytes::new(&payload_buf)
25091 } else {
25092 Bytes::new(__input)
25093 };
25094 let mut __struct = Self::default();
25095 __struct.req_message_rate = buf.get_u16_le();
25096 __struct.target_system = buf.get_u8();
25097 __struct.target_component = buf.get_u8();
25098 __struct.req_stream_id = buf.get_u8();
25099 __struct.start_stop = buf.get_u8();
25100 Ok(__struct)
25101 }
25102 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25103 let mut __tmp = BytesMut::new(bytes);
25104 #[allow(clippy::absurd_extreme_comparisons)]
25105 #[allow(unused_comparisons)]
25106 if __tmp.remaining() < Self::ENCODED_LEN {
25107 panic!(
25108 "buffer is too small (need {} bytes, but got {})",
25109 Self::ENCODED_LEN,
25110 __tmp.remaining(),
25111 )
25112 }
25113 __tmp.put_u16_le(self.req_message_rate);
25114 __tmp.put_u8(self.target_system);
25115 __tmp.put_u8(self.target_component);
25116 __tmp.put_u8(self.req_stream_id);
25117 __tmp.put_u8(self.start_stop);
25118 if matches!(version, MavlinkVersion::V2) {
25119 let len = __tmp.len();
25120 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25121 } else {
25122 __tmp.len()
25123 }
25124 }
25125}
25126#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
25127#[doc = ""]
25128#[doc = "ID: 412"]
25129#[derive(Debug, Clone, PartialEq)]
25130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25131#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25132pub struct REQUEST_EVENT_DATA {
25133 #[doc = "First sequence number of the requested event."]
25134 pub first_sequence: u16,
25135 #[doc = "Last sequence number of the requested event."]
25136 pub last_sequence: u16,
25137 #[doc = "System ID"]
25138 pub target_system: u8,
25139 #[doc = "Component ID"]
25140 pub target_component: u8,
25141}
25142impl REQUEST_EVENT_DATA {
25143 pub const ENCODED_LEN: usize = 6usize;
25144 pub const DEFAULT: Self = Self {
25145 first_sequence: 0_u16,
25146 last_sequence: 0_u16,
25147 target_system: 0_u8,
25148 target_component: 0_u8,
25149 };
25150 #[cfg(feature = "arbitrary")]
25151 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25152 use arbitrary::{Arbitrary, Unstructured};
25153 let mut buf = [0u8; 1024];
25154 rng.fill_bytes(&mut buf);
25155 let mut unstructured = Unstructured::new(&buf);
25156 Self::arbitrary(&mut unstructured).unwrap_or_default()
25157 }
25158}
25159impl Default for REQUEST_EVENT_DATA {
25160 fn default() -> Self {
25161 Self::DEFAULT.clone()
25162 }
25163}
25164impl MessageData for REQUEST_EVENT_DATA {
25165 type Message = MavMessage;
25166 const ID: u32 = 412u32;
25167 const NAME: &'static str = "REQUEST_EVENT";
25168 const EXTRA_CRC: u8 = 33u8;
25169 const ENCODED_LEN: usize = 6usize;
25170 fn deser(
25171 _version: MavlinkVersion,
25172 __input: &[u8],
25173 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25174 let avail_len = __input.len();
25175 let mut payload_buf = [0; Self::ENCODED_LEN];
25176 let mut buf = if avail_len < Self::ENCODED_LEN {
25177 payload_buf[0..avail_len].copy_from_slice(__input);
25178 Bytes::new(&payload_buf)
25179 } else {
25180 Bytes::new(__input)
25181 };
25182 let mut __struct = Self::default();
25183 __struct.first_sequence = buf.get_u16_le();
25184 __struct.last_sequence = buf.get_u16_le();
25185 __struct.target_system = buf.get_u8();
25186 __struct.target_component = buf.get_u8();
25187 Ok(__struct)
25188 }
25189 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25190 let mut __tmp = BytesMut::new(bytes);
25191 #[allow(clippy::absurd_extreme_comparisons)]
25192 #[allow(unused_comparisons)]
25193 if __tmp.remaining() < Self::ENCODED_LEN {
25194 panic!(
25195 "buffer is too small (need {} bytes, but got {})",
25196 Self::ENCODED_LEN,
25197 __tmp.remaining(),
25198 )
25199 }
25200 __tmp.put_u16_le(self.first_sequence);
25201 __tmp.put_u16_le(self.last_sequence);
25202 __tmp.put_u8(self.target_system);
25203 __tmp.put_u8(self.target_component);
25204 if matches!(version, MavlinkVersion::V2) {
25205 let len = __tmp.len();
25206 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25207 } else {
25208 __tmp.len()
25209 }
25210 }
25211}
25212#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
25213#[doc = ""]
25214#[doc = "ID: 142"]
25215#[derive(Debug, Clone, PartialEq)]
25216#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25218pub struct RESOURCE_REQUEST_DATA {
25219 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
25220 pub request_id: u8,
25221 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
25222 pub uri_type: u8,
25223 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
25224 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25225 pub uri: [u8; 120],
25226 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
25227 pub transfer_type: u8,
25228 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
25229 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25230 pub storage: [u8; 120],
25231}
25232impl RESOURCE_REQUEST_DATA {
25233 pub const ENCODED_LEN: usize = 243usize;
25234 pub const DEFAULT: Self = Self {
25235 request_id: 0_u8,
25236 uri_type: 0_u8,
25237 uri: [0_u8; 120usize],
25238 transfer_type: 0_u8,
25239 storage: [0_u8; 120usize],
25240 };
25241 #[cfg(feature = "arbitrary")]
25242 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25243 use arbitrary::{Arbitrary, Unstructured};
25244 let mut buf = [0u8; 1024];
25245 rng.fill_bytes(&mut buf);
25246 let mut unstructured = Unstructured::new(&buf);
25247 Self::arbitrary(&mut unstructured).unwrap_or_default()
25248 }
25249}
25250impl Default for RESOURCE_REQUEST_DATA {
25251 fn default() -> Self {
25252 Self::DEFAULT.clone()
25253 }
25254}
25255impl MessageData for RESOURCE_REQUEST_DATA {
25256 type Message = MavMessage;
25257 const ID: u32 = 142u32;
25258 const NAME: &'static str = "RESOURCE_REQUEST";
25259 const EXTRA_CRC: u8 = 72u8;
25260 const ENCODED_LEN: usize = 243usize;
25261 fn deser(
25262 _version: MavlinkVersion,
25263 __input: &[u8],
25264 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25265 let avail_len = __input.len();
25266 let mut payload_buf = [0; Self::ENCODED_LEN];
25267 let mut buf = if avail_len < Self::ENCODED_LEN {
25268 payload_buf[0..avail_len].copy_from_slice(__input);
25269 Bytes::new(&payload_buf)
25270 } else {
25271 Bytes::new(__input)
25272 };
25273 let mut __struct = Self::default();
25274 __struct.request_id = buf.get_u8();
25275 __struct.uri_type = buf.get_u8();
25276 for v in &mut __struct.uri {
25277 let val = buf.get_u8();
25278 *v = val;
25279 }
25280 __struct.transfer_type = buf.get_u8();
25281 for v in &mut __struct.storage {
25282 let val = buf.get_u8();
25283 *v = val;
25284 }
25285 Ok(__struct)
25286 }
25287 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25288 let mut __tmp = BytesMut::new(bytes);
25289 #[allow(clippy::absurd_extreme_comparisons)]
25290 #[allow(unused_comparisons)]
25291 if __tmp.remaining() < Self::ENCODED_LEN {
25292 panic!(
25293 "buffer is too small (need {} bytes, but got {})",
25294 Self::ENCODED_LEN,
25295 __tmp.remaining(),
25296 )
25297 }
25298 __tmp.put_u8(self.request_id);
25299 __tmp.put_u8(self.uri_type);
25300 for val in &self.uri {
25301 __tmp.put_u8(*val);
25302 }
25303 __tmp.put_u8(self.transfer_type);
25304 for val in &self.storage {
25305 __tmp.put_u8(*val);
25306 }
25307 if matches!(version, MavlinkVersion::V2) {
25308 let len = __tmp.len();
25309 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25310 } else {
25311 __tmp.len()
25312 }
25313 }
25314}
25315#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
25316#[doc = ""]
25317#[doc = "ID: 413"]
25318#[derive(Debug, Clone, PartialEq)]
25319#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25320#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25321pub struct RESPONSE_EVENT_ERROR_DATA {
25322 #[doc = "Sequence number."]
25323 pub sequence: u16,
25324 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
25325 pub sequence_oldest_available: u16,
25326 #[doc = "System ID"]
25327 pub target_system: u8,
25328 #[doc = "Component ID"]
25329 pub target_component: u8,
25330 #[doc = "Error reason."]
25331 pub reason: MavEventErrorReason,
25332}
25333impl RESPONSE_EVENT_ERROR_DATA {
25334 pub const ENCODED_LEN: usize = 7usize;
25335 pub const DEFAULT: Self = Self {
25336 sequence: 0_u16,
25337 sequence_oldest_available: 0_u16,
25338 target_system: 0_u8,
25339 target_component: 0_u8,
25340 reason: MavEventErrorReason::DEFAULT,
25341 };
25342 #[cfg(feature = "arbitrary")]
25343 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25344 use arbitrary::{Arbitrary, Unstructured};
25345 let mut buf = [0u8; 1024];
25346 rng.fill_bytes(&mut buf);
25347 let mut unstructured = Unstructured::new(&buf);
25348 Self::arbitrary(&mut unstructured).unwrap_or_default()
25349 }
25350}
25351impl Default for RESPONSE_EVENT_ERROR_DATA {
25352 fn default() -> Self {
25353 Self::DEFAULT.clone()
25354 }
25355}
25356impl MessageData for RESPONSE_EVENT_ERROR_DATA {
25357 type Message = MavMessage;
25358 const ID: u32 = 413u32;
25359 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
25360 const EXTRA_CRC: u8 = 77u8;
25361 const ENCODED_LEN: usize = 7usize;
25362 fn deser(
25363 _version: MavlinkVersion,
25364 __input: &[u8],
25365 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25366 let avail_len = __input.len();
25367 let mut payload_buf = [0; Self::ENCODED_LEN];
25368 let mut buf = if avail_len < Self::ENCODED_LEN {
25369 payload_buf[0..avail_len].copy_from_slice(__input);
25370 Bytes::new(&payload_buf)
25371 } else {
25372 Bytes::new(__input)
25373 };
25374 let mut __struct = Self::default();
25375 __struct.sequence = buf.get_u16_le();
25376 __struct.sequence_oldest_available = buf.get_u16_le();
25377 __struct.target_system = buf.get_u8();
25378 __struct.target_component = buf.get_u8();
25379 let tmp = buf.get_u8();
25380 __struct.reason =
25381 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25382 enum_type: "MavEventErrorReason",
25383 value: tmp as u32,
25384 })?;
25385 Ok(__struct)
25386 }
25387 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25388 let mut __tmp = BytesMut::new(bytes);
25389 #[allow(clippy::absurd_extreme_comparisons)]
25390 #[allow(unused_comparisons)]
25391 if __tmp.remaining() < Self::ENCODED_LEN {
25392 panic!(
25393 "buffer is too small (need {} bytes, but got {})",
25394 Self::ENCODED_LEN,
25395 __tmp.remaining(),
25396 )
25397 }
25398 __tmp.put_u16_le(self.sequence);
25399 __tmp.put_u16_le(self.sequence_oldest_available);
25400 __tmp.put_u8(self.target_system);
25401 __tmp.put_u8(self.target_component);
25402 __tmp.put_u8(self.reason as u8);
25403 if matches!(version, MavlinkVersion::V2) {
25404 let len = __tmp.len();
25405 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25406 } else {
25407 __tmp.len()
25408 }
25409 }
25410}
25411#[doc = "Read out the safety zone the MAV currently assumes."]
25412#[doc = ""]
25413#[doc = "ID: 55"]
25414#[derive(Debug, Clone, PartialEq)]
25415#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25416#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25417pub struct SAFETY_ALLOWED_AREA_DATA {
25418 #[doc = "x position 1 / Latitude 1"]
25419 pub p1x: f32,
25420 #[doc = "y position 1 / Longitude 1"]
25421 pub p1y: f32,
25422 #[doc = "z position 1 / Altitude 1"]
25423 pub p1z: f32,
25424 #[doc = "x position 2 / Latitude 2"]
25425 pub p2x: f32,
25426 #[doc = "y position 2 / Longitude 2"]
25427 pub p2y: f32,
25428 #[doc = "z position 2 / Altitude 2"]
25429 pub p2z: f32,
25430 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25431 pub frame: MavFrame,
25432}
25433impl SAFETY_ALLOWED_AREA_DATA {
25434 pub const ENCODED_LEN: usize = 25usize;
25435 pub const DEFAULT: Self = Self {
25436 p1x: 0.0_f32,
25437 p1y: 0.0_f32,
25438 p1z: 0.0_f32,
25439 p2x: 0.0_f32,
25440 p2y: 0.0_f32,
25441 p2z: 0.0_f32,
25442 frame: MavFrame::DEFAULT,
25443 };
25444 #[cfg(feature = "arbitrary")]
25445 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25446 use arbitrary::{Arbitrary, Unstructured};
25447 let mut buf = [0u8; 1024];
25448 rng.fill_bytes(&mut buf);
25449 let mut unstructured = Unstructured::new(&buf);
25450 Self::arbitrary(&mut unstructured).unwrap_or_default()
25451 }
25452}
25453impl Default for SAFETY_ALLOWED_AREA_DATA {
25454 fn default() -> Self {
25455 Self::DEFAULT.clone()
25456 }
25457}
25458impl MessageData for SAFETY_ALLOWED_AREA_DATA {
25459 type Message = MavMessage;
25460 const ID: u32 = 55u32;
25461 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
25462 const EXTRA_CRC: u8 = 3u8;
25463 const ENCODED_LEN: usize = 25usize;
25464 fn deser(
25465 _version: MavlinkVersion,
25466 __input: &[u8],
25467 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25468 let avail_len = __input.len();
25469 let mut payload_buf = [0; Self::ENCODED_LEN];
25470 let mut buf = if avail_len < Self::ENCODED_LEN {
25471 payload_buf[0..avail_len].copy_from_slice(__input);
25472 Bytes::new(&payload_buf)
25473 } else {
25474 Bytes::new(__input)
25475 };
25476 let mut __struct = Self::default();
25477 __struct.p1x = buf.get_f32_le();
25478 __struct.p1y = buf.get_f32_le();
25479 __struct.p1z = buf.get_f32_le();
25480 __struct.p2x = buf.get_f32_le();
25481 __struct.p2y = buf.get_f32_le();
25482 __struct.p2z = buf.get_f32_le();
25483 let tmp = buf.get_u8();
25484 __struct.frame =
25485 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25486 enum_type: "MavFrame",
25487 value: tmp as u32,
25488 })?;
25489 Ok(__struct)
25490 }
25491 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25492 let mut __tmp = BytesMut::new(bytes);
25493 #[allow(clippy::absurd_extreme_comparisons)]
25494 #[allow(unused_comparisons)]
25495 if __tmp.remaining() < Self::ENCODED_LEN {
25496 panic!(
25497 "buffer is too small (need {} bytes, but got {})",
25498 Self::ENCODED_LEN,
25499 __tmp.remaining(),
25500 )
25501 }
25502 __tmp.put_f32_le(self.p1x);
25503 __tmp.put_f32_le(self.p1y);
25504 __tmp.put_f32_le(self.p1z);
25505 __tmp.put_f32_le(self.p2x);
25506 __tmp.put_f32_le(self.p2y);
25507 __tmp.put_f32_le(self.p2z);
25508 __tmp.put_u8(self.frame as u8);
25509 if matches!(version, MavlinkVersion::V2) {
25510 let len = __tmp.len();
25511 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25512 } else {
25513 __tmp.len()
25514 }
25515 }
25516}
25517#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
25518#[doc = ""]
25519#[doc = "ID: 54"]
25520#[derive(Debug, Clone, PartialEq)]
25521#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25522#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25523pub struct SAFETY_SET_ALLOWED_AREA_DATA {
25524 #[doc = "x position 1 / Latitude 1"]
25525 pub p1x: f32,
25526 #[doc = "y position 1 / Longitude 1"]
25527 pub p1y: f32,
25528 #[doc = "z position 1 / Altitude 1"]
25529 pub p1z: f32,
25530 #[doc = "x position 2 / Latitude 2"]
25531 pub p2x: f32,
25532 #[doc = "y position 2 / Longitude 2"]
25533 pub p2y: f32,
25534 #[doc = "z position 2 / Altitude 2"]
25535 pub p2z: f32,
25536 #[doc = "System ID"]
25537 pub target_system: u8,
25538 #[doc = "Component ID"]
25539 pub target_component: u8,
25540 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25541 pub frame: MavFrame,
25542}
25543impl SAFETY_SET_ALLOWED_AREA_DATA {
25544 pub const ENCODED_LEN: usize = 27usize;
25545 pub const DEFAULT: Self = Self {
25546 p1x: 0.0_f32,
25547 p1y: 0.0_f32,
25548 p1z: 0.0_f32,
25549 p2x: 0.0_f32,
25550 p2y: 0.0_f32,
25551 p2z: 0.0_f32,
25552 target_system: 0_u8,
25553 target_component: 0_u8,
25554 frame: MavFrame::DEFAULT,
25555 };
25556 #[cfg(feature = "arbitrary")]
25557 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25558 use arbitrary::{Arbitrary, Unstructured};
25559 let mut buf = [0u8; 1024];
25560 rng.fill_bytes(&mut buf);
25561 let mut unstructured = Unstructured::new(&buf);
25562 Self::arbitrary(&mut unstructured).unwrap_or_default()
25563 }
25564}
25565impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
25566 fn default() -> Self {
25567 Self::DEFAULT.clone()
25568 }
25569}
25570impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
25571 type Message = MavMessage;
25572 const ID: u32 = 54u32;
25573 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
25574 const EXTRA_CRC: u8 = 15u8;
25575 const ENCODED_LEN: usize = 27usize;
25576 fn deser(
25577 _version: MavlinkVersion,
25578 __input: &[u8],
25579 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25580 let avail_len = __input.len();
25581 let mut payload_buf = [0; Self::ENCODED_LEN];
25582 let mut buf = if avail_len < Self::ENCODED_LEN {
25583 payload_buf[0..avail_len].copy_from_slice(__input);
25584 Bytes::new(&payload_buf)
25585 } else {
25586 Bytes::new(__input)
25587 };
25588 let mut __struct = Self::default();
25589 __struct.p1x = buf.get_f32_le();
25590 __struct.p1y = buf.get_f32_le();
25591 __struct.p1z = buf.get_f32_le();
25592 __struct.p2x = buf.get_f32_le();
25593 __struct.p2y = buf.get_f32_le();
25594 __struct.p2z = buf.get_f32_le();
25595 __struct.target_system = buf.get_u8();
25596 __struct.target_component = buf.get_u8();
25597 let tmp = buf.get_u8();
25598 __struct.frame =
25599 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25600 enum_type: "MavFrame",
25601 value: tmp as u32,
25602 })?;
25603 Ok(__struct)
25604 }
25605 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25606 let mut __tmp = BytesMut::new(bytes);
25607 #[allow(clippy::absurd_extreme_comparisons)]
25608 #[allow(unused_comparisons)]
25609 if __tmp.remaining() < Self::ENCODED_LEN {
25610 panic!(
25611 "buffer is too small (need {} bytes, but got {})",
25612 Self::ENCODED_LEN,
25613 __tmp.remaining(),
25614 )
25615 }
25616 __tmp.put_f32_le(self.p1x);
25617 __tmp.put_f32_le(self.p1y);
25618 __tmp.put_f32_le(self.p1z);
25619 __tmp.put_f32_le(self.p2x);
25620 __tmp.put_f32_le(self.p2y);
25621 __tmp.put_f32_le(self.p2z);
25622 __tmp.put_u8(self.target_system);
25623 __tmp.put_u8(self.target_component);
25624 __tmp.put_u8(self.frame as u8);
25625 if matches!(version, MavlinkVersion::V2) {
25626 let len = __tmp.len();
25627 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25628 } else {
25629 __tmp.len()
25630 }
25631 }
25632}
25633#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
25634#[doc = ""]
25635#[doc = "ID: 26"]
25636#[derive(Debug, Clone, PartialEq)]
25637#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25638#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25639pub struct SCALED_IMU_DATA {
25640 #[doc = "Timestamp (time since system boot)."]
25641 pub time_boot_ms: u32,
25642 #[doc = "X acceleration"]
25643 pub xacc: i16,
25644 #[doc = "Y acceleration"]
25645 pub yacc: i16,
25646 #[doc = "Z acceleration"]
25647 pub zacc: i16,
25648 #[doc = "Angular speed around X axis"]
25649 pub xgyro: i16,
25650 #[doc = "Angular speed around Y axis"]
25651 pub ygyro: i16,
25652 #[doc = "Angular speed around Z axis"]
25653 pub zgyro: i16,
25654 #[doc = "X Magnetic field"]
25655 pub xmag: i16,
25656 #[doc = "Y Magnetic field"]
25657 pub ymag: i16,
25658 #[doc = "Z Magnetic field"]
25659 pub zmag: i16,
25660 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25661 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25662 pub temperature: i16,
25663}
25664impl SCALED_IMU_DATA {
25665 pub const ENCODED_LEN: usize = 24usize;
25666 pub const DEFAULT: Self = Self {
25667 time_boot_ms: 0_u32,
25668 xacc: 0_i16,
25669 yacc: 0_i16,
25670 zacc: 0_i16,
25671 xgyro: 0_i16,
25672 ygyro: 0_i16,
25673 zgyro: 0_i16,
25674 xmag: 0_i16,
25675 ymag: 0_i16,
25676 zmag: 0_i16,
25677 temperature: 0_i16,
25678 };
25679 #[cfg(feature = "arbitrary")]
25680 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25681 use arbitrary::{Arbitrary, Unstructured};
25682 let mut buf = [0u8; 1024];
25683 rng.fill_bytes(&mut buf);
25684 let mut unstructured = Unstructured::new(&buf);
25685 Self::arbitrary(&mut unstructured).unwrap_or_default()
25686 }
25687}
25688impl Default for SCALED_IMU_DATA {
25689 fn default() -> Self {
25690 Self::DEFAULT.clone()
25691 }
25692}
25693impl MessageData for SCALED_IMU_DATA {
25694 type Message = MavMessage;
25695 const ID: u32 = 26u32;
25696 const NAME: &'static str = "SCALED_IMU";
25697 const EXTRA_CRC: u8 = 170u8;
25698 const ENCODED_LEN: usize = 24usize;
25699 fn deser(
25700 _version: MavlinkVersion,
25701 __input: &[u8],
25702 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25703 let avail_len = __input.len();
25704 let mut payload_buf = [0; Self::ENCODED_LEN];
25705 let mut buf = if avail_len < Self::ENCODED_LEN {
25706 payload_buf[0..avail_len].copy_from_slice(__input);
25707 Bytes::new(&payload_buf)
25708 } else {
25709 Bytes::new(__input)
25710 };
25711 let mut __struct = Self::default();
25712 __struct.time_boot_ms = buf.get_u32_le();
25713 __struct.xacc = buf.get_i16_le();
25714 __struct.yacc = buf.get_i16_le();
25715 __struct.zacc = buf.get_i16_le();
25716 __struct.xgyro = buf.get_i16_le();
25717 __struct.ygyro = buf.get_i16_le();
25718 __struct.zgyro = buf.get_i16_le();
25719 __struct.xmag = buf.get_i16_le();
25720 __struct.ymag = buf.get_i16_le();
25721 __struct.zmag = buf.get_i16_le();
25722 __struct.temperature = buf.get_i16_le();
25723 Ok(__struct)
25724 }
25725 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25726 let mut __tmp = BytesMut::new(bytes);
25727 #[allow(clippy::absurd_extreme_comparisons)]
25728 #[allow(unused_comparisons)]
25729 if __tmp.remaining() < Self::ENCODED_LEN {
25730 panic!(
25731 "buffer is too small (need {} bytes, but got {})",
25732 Self::ENCODED_LEN,
25733 __tmp.remaining(),
25734 )
25735 }
25736 __tmp.put_u32_le(self.time_boot_ms);
25737 __tmp.put_i16_le(self.xacc);
25738 __tmp.put_i16_le(self.yacc);
25739 __tmp.put_i16_le(self.zacc);
25740 __tmp.put_i16_le(self.xgyro);
25741 __tmp.put_i16_le(self.ygyro);
25742 __tmp.put_i16_le(self.zgyro);
25743 __tmp.put_i16_le(self.xmag);
25744 __tmp.put_i16_le(self.ymag);
25745 __tmp.put_i16_le(self.zmag);
25746 if matches!(version, MavlinkVersion::V2) {
25747 __tmp.put_i16_le(self.temperature);
25748 let len = __tmp.len();
25749 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25750 } else {
25751 __tmp.len()
25752 }
25753 }
25754}
25755#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
25756#[doc = ""]
25757#[doc = "ID: 116"]
25758#[derive(Debug, Clone, PartialEq)]
25759#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25761pub struct SCALED_IMU2_DATA {
25762 #[doc = "Timestamp (time since system boot)."]
25763 pub time_boot_ms: u32,
25764 #[doc = "X acceleration"]
25765 pub xacc: i16,
25766 #[doc = "Y acceleration"]
25767 pub yacc: i16,
25768 #[doc = "Z acceleration"]
25769 pub zacc: i16,
25770 #[doc = "Angular speed around X axis"]
25771 pub xgyro: i16,
25772 #[doc = "Angular speed around Y axis"]
25773 pub ygyro: i16,
25774 #[doc = "Angular speed around Z axis"]
25775 pub zgyro: i16,
25776 #[doc = "X Magnetic field"]
25777 pub xmag: i16,
25778 #[doc = "Y Magnetic field"]
25779 pub ymag: i16,
25780 #[doc = "Z Magnetic field"]
25781 pub zmag: i16,
25782 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25783 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25784 pub temperature: i16,
25785}
25786impl SCALED_IMU2_DATA {
25787 pub const ENCODED_LEN: usize = 24usize;
25788 pub const DEFAULT: Self = Self {
25789 time_boot_ms: 0_u32,
25790 xacc: 0_i16,
25791 yacc: 0_i16,
25792 zacc: 0_i16,
25793 xgyro: 0_i16,
25794 ygyro: 0_i16,
25795 zgyro: 0_i16,
25796 xmag: 0_i16,
25797 ymag: 0_i16,
25798 zmag: 0_i16,
25799 temperature: 0_i16,
25800 };
25801 #[cfg(feature = "arbitrary")]
25802 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25803 use arbitrary::{Arbitrary, Unstructured};
25804 let mut buf = [0u8; 1024];
25805 rng.fill_bytes(&mut buf);
25806 let mut unstructured = Unstructured::new(&buf);
25807 Self::arbitrary(&mut unstructured).unwrap_or_default()
25808 }
25809}
25810impl Default for SCALED_IMU2_DATA {
25811 fn default() -> Self {
25812 Self::DEFAULT.clone()
25813 }
25814}
25815impl MessageData for SCALED_IMU2_DATA {
25816 type Message = MavMessage;
25817 const ID: u32 = 116u32;
25818 const NAME: &'static str = "SCALED_IMU2";
25819 const EXTRA_CRC: u8 = 76u8;
25820 const ENCODED_LEN: usize = 24usize;
25821 fn deser(
25822 _version: MavlinkVersion,
25823 __input: &[u8],
25824 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25825 let avail_len = __input.len();
25826 let mut payload_buf = [0; Self::ENCODED_LEN];
25827 let mut buf = if avail_len < Self::ENCODED_LEN {
25828 payload_buf[0..avail_len].copy_from_slice(__input);
25829 Bytes::new(&payload_buf)
25830 } else {
25831 Bytes::new(__input)
25832 };
25833 let mut __struct = Self::default();
25834 __struct.time_boot_ms = buf.get_u32_le();
25835 __struct.xacc = buf.get_i16_le();
25836 __struct.yacc = buf.get_i16_le();
25837 __struct.zacc = buf.get_i16_le();
25838 __struct.xgyro = buf.get_i16_le();
25839 __struct.ygyro = buf.get_i16_le();
25840 __struct.zgyro = buf.get_i16_le();
25841 __struct.xmag = buf.get_i16_le();
25842 __struct.ymag = buf.get_i16_le();
25843 __struct.zmag = buf.get_i16_le();
25844 __struct.temperature = buf.get_i16_le();
25845 Ok(__struct)
25846 }
25847 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25848 let mut __tmp = BytesMut::new(bytes);
25849 #[allow(clippy::absurd_extreme_comparisons)]
25850 #[allow(unused_comparisons)]
25851 if __tmp.remaining() < Self::ENCODED_LEN {
25852 panic!(
25853 "buffer is too small (need {} bytes, but got {})",
25854 Self::ENCODED_LEN,
25855 __tmp.remaining(),
25856 )
25857 }
25858 __tmp.put_u32_le(self.time_boot_ms);
25859 __tmp.put_i16_le(self.xacc);
25860 __tmp.put_i16_le(self.yacc);
25861 __tmp.put_i16_le(self.zacc);
25862 __tmp.put_i16_le(self.xgyro);
25863 __tmp.put_i16_le(self.ygyro);
25864 __tmp.put_i16_le(self.zgyro);
25865 __tmp.put_i16_le(self.xmag);
25866 __tmp.put_i16_le(self.ymag);
25867 __tmp.put_i16_le(self.zmag);
25868 if matches!(version, MavlinkVersion::V2) {
25869 __tmp.put_i16_le(self.temperature);
25870 let len = __tmp.len();
25871 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25872 } else {
25873 __tmp.len()
25874 }
25875 }
25876}
25877#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
25878#[doc = ""]
25879#[doc = "ID: 129"]
25880#[derive(Debug, Clone, PartialEq)]
25881#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25882#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25883pub struct SCALED_IMU3_DATA {
25884 #[doc = "Timestamp (time since system boot)."]
25885 pub time_boot_ms: u32,
25886 #[doc = "X acceleration"]
25887 pub xacc: i16,
25888 #[doc = "Y acceleration"]
25889 pub yacc: i16,
25890 #[doc = "Z acceleration"]
25891 pub zacc: i16,
25892 #[doc = "Angular speed around X axis"]
25893 pub xgyro: i16,
25894 #[doc = "Angular speed around Y axis"]
25895 pub ygyro: i16,
25896 #[doc = "Angular speed around Z axis"]
25897 pub zgyro: i16,
25898 #[doc = "X Magnetic field"]
25899 pub xmag: i16,
25900 #[doc = "Y Magnetic field"]
25901 pub ymag: i16,
25902 #[doc = "Z Magnetic field"]
25903 pub zmag: i16,
25904 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25905 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25906 pub temperature: i16,
25907}
25908impl SCALED_IMU3_DATA {
25909 pub const ENCODED_LEN: usize = 24usize;
25910 pub const DEFAULT: Self = Self {
25911 time_boot_ms: 0_u32,
25912 xacc: 0_i16,
25913 yacc: 0_i16,
25914 zacc: 0_i16,
25915 xgyro: 0_i16,
25916 ygyro: 0_i16,
25917 zgyro: 0_i16,
25918 xmag: 0_i16,
25919 ymag: 0_i16,
25920 zmag: 0_i16,
25921 temperature: 0_i16,
25922 };
25923 #[cfg(feature = "arbitrary")]
25924 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25925 use arbitrary::{Arbitrary, Unstructured};
25926 let mut buf = [0u8; 1024];
25927 rng.fill_bytes(&mut buf);
25928 let mut unstructured = Unstructured::new(&buf);
25929 Self::arbitrary(&mut unstructured).unwrap_or_default()
25930 }
25931}
25932impl Default for SCALED_IMU3_DATA {
25933 fn default() -> Self {
25934 Self::DEFAULT.clone()
25935 }
25936}
25937impl MessageData for SCALED_IMU3_DATA {
25938 type Message = MavMessage;
25939 const ID: u32 = 129u32;
25940 const NAME: &'static str = "SCALED_IMU3";
25941 const EXTRA_CRC: u8 = 46u8;
25942 const ENCODED_LEN: usize = 24usize;
25943 fn deser(
25944 _version: MavlinkVersion,
25945 __input: &[u8],
25946 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25947 let avail_len = __input.len();
25948 let mut payload_buf = [0; Self::ENCODED_LEN];
25949 let mut buf = if avail_len < Self::ENCODED_LEN {
25950 payload_buf[0..avail_len].copy_from_slice(__input);
25951 Bytes::new(&payload_buf)
25952 } else {
25953 Bytes::new(__input)
25954 };
25955 let mut __struct = Self::default();
25956 __struct.time_boot_ms = buf.get_u32_le();
25957 __struct.xacc = buf.get_i16_le();
25958 __struct.yacc = buf.get_i16_le();
25959 __struct.zacc = buf.get_i16_le();
25960 __struct.xgyro = buf.get_i16_le();
25961 __struct.ygyro = buf.get_i16_le();
25962 __struct.zgyro = buf.get_i16_le();
25963 __struct.xmag = buf.get_i16_le();
25964 __struct.ymag = buf.get_i16_le();
25965 __struct.zmag = buf.get_i16_le();
25966 __struct.temperature = buf.get_i16_le();
25967 Ok(__struct)
25968 }
25969 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25970 let mut __tmp = BytesMut::new(bytes);
25971 #[allow(clippy::absurd_extreme_comparisons)]
25972 #[allow(unused_comparisons)]
25973 if __tmp.remaining() < Self::ENCODED_LEN {
25974 panic!(
25975 "buffer is too small (need {} bytes, but got {})",
25976 Self::ENCODED_LEN,
25977 __tmp.remaining(),
25978 )
25979 }
25980 __tmp.put_u32_le(self.time_boot_ms);
25981 __tmp.put_i16_le(self.xacc);
25982 __tmp.put_i16_le(self.yacc);
25983 __tmp.put_i16_le(self.zacc);
25984 __tmp.put_i16_le(self.xgyro);
25985 __tmp.put_i16_le(self.ygyro);
25986 __tmp.put_i16_le(self.zgyro);
25987 __tmp.put_i16_le(self.xmag);
25988 __tmp.put_i16_le(self.ymag);
25989 __tmp.put_i16_le(self.zmag);
25990 if matches!(version, MavlinkVersion::V2) {
25991 __tmp.put_i16_le(self.temperature);
25992 let len = __tmp.len();
25993 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25994 } else {
25995 __tmp.len()
25996 }
25997 }
25998}
25999#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
26000#[doc = ""]
26001#[doc = "ID: 29"]
26002#[derive(Debug, Clone, PartialEq)]
26003#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26004#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26005pub struct SCALED_PRESSURE_DATA {
26006 #[doc = "Timestamp (time since system boot)."]
26007 pub time_boot_ms: u32,
26008 #[doc = "Absolute pressure"]
26009 pub press_abs: f32,
26010 #[doc = "Differential pressure 1"]
26011 pub press_diff: f32,
26012 #[doc = "Absolute pressure temperature"]
26013 pub temperature: i16,
26014 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26015 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26016 pub temperature_press_diff: i16,
26017}
26018impl SCALED_PRESSURE_DATA {
26019 pub const ENCODED_LEN: usize = 16usize;
26020 pub const DEFAULT: Self = Self {
26021 time_boot_ms: 0_u32,
26022 press_abs: 0.0_f32,
26023 press_diff: 0.0_f32,
26024 temperature: 0_i16,
26025 temperature_press_diff: 0_i16,
26026 };
26027 #[cfg(feature = "arbitrary")]
26028 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26029 use arbitrary::{Arbitrary, Unstructured};
26030 let mut buf = [0u8; 1024];
26031 rng.fill_bytes(&mut buf);
26032 let mut unstructured = Unstructured::new(&buf);
26033 Self::arbitrary(&mut unstructured).unwrap_or_default()
26034 }
26035}
26036impl Default for SCALED_PRESSURE_DATA {
26037 fn default() -> Self {
26038 Self::DEFAULT.clone()
26039 }
26040}
26041impl MessageData for SCALED_PRESSURE_DATA {
26042 type Message = MavMessage;
26043 const ID: u32 = 29u32;
26044 const NAME: &'static str = "SCALED_PRESSURE";
26045 const EXTRA_CRC: u8 = 115u8;
26046 const ENCODED_LEN: usize = 16usize;
26047 fn deser(
26048 _version: MavlinkVersion,
26049 __input: &[u8],
26050 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26051 let avail_len = __input.len();
26052 let mut payload_buf = [0; Self::ENCODED_LEN];
26053 let mut buf = if avail_len < Self::ENCODED_LEN {
26054 payload_buf[0..avail_len].copy_from_slice(__input);
26055 Bytes::new(&payload_buf)
26056 } else {
26057 Bytes::new(__input)
26058 };
26059 let mut __struct = Self::default();
26060 __struct.time_boot_ms = buf.get_u32_le();
26061 __struct.press_abs = buf.get_f32_le();
26062 __struct.press_diff = buf.get_f32_le();
26063 __struct.temperature = buf.get_i16_le();
26064 __struct.temperature_press_diff = buf.get_i16_le();
26065 Ok(__struct)
26066 }
26067 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26068 let mut __tmp = BytesMut::new(bytes);
26069 #[allow(clippy::absurd_extreme_comparisons)]
26070 #[allow(unused_comparisons)]
26071 if __tmp.remaining() < Self::ENCODED_LEN {
26072 panic!(
26073 "buffer is too small (need {} bytes, but got {})",
26074 Self::ENCODED_LEN,
26075 __tmp.remaining(),
26076 )
26077 }
26078 __tmp.put_u32_le(self.time_boot_ms);
26079 __tmp.put_f32_le(self.press_abs);
26080 __tmp.put_f32_le(self.press_diff);
26081 __tmp.put_i16_le(self.temperature);
26082 if matches!(version, MavlinkVersion::V2) {
26083 __tmp.put_i16_le(self.temperature_press_diff);
26084 let len = __tmp.len();
26085 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26086 } else {
26087 __tmp.len()
26088 }
26089 }
26090}
26091#[doc = "Barometer readings for 2nd barometer."]
26092#[doc = ""]
26093#[doc = "ID: 137"]
26094#[derive(Debug, Clone, PartialEq)]
26095#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26096#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26097pub struct SCALED_PRESSURE2_DATA {
26098 #[doc = "Timestamp (time since system boot)."]
26099 pub time_boot_ms: u32,
26100 #[doc = "Absolute pressure"]
26101 pub press_abs: f32,
26102 #[doc = "Differential pressure"]
26103 pub press_diff: f32,
26104 #[doc = "Absolute pressure temperature"]
26105 pub temperature: i16,
26106 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26107 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26108 pub temperature_press_diff: i16,
26109}
26110impl SCALED_PRESSURE2_DATA {
26111 pub const ENCODED_LEN: usize = 16usize;
26112 pub const DEFAULT: Self = Self {
26113 time_boot_ms: 0_u32,
26114 press_abs: 0.0_f32,
26115 press_diff: 0.0_f32,
26116 temperature: 0_i16,
26117 temperature_press_diff: 0_i16,
26118 };
26119 #[cfg(feature = "arbitrary")]
26120 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26121 use arbitrary::{Arbitrary, Unstructured};
26122 let mut buf = [0u8; 1024];
26123 rng.fill_bytes(&mut buf);
26124 let mut unstructured = Unstructured::new(&buf);
26125 Self::arbitrary(&mut unstructured).unwrap_or_default()
26126 }
26127}
26128impl Default for SCALED_PRESSURE2_DATA {
26129 fn default() -> Self {
26130 Self::DEFAULT.clone()
26131 }
26132}
26133impl MessageData for SCALED_PRESSURE2_DATA {
26134 type Message = MavMessage;
26135 const ID: u32 = 137u32;
26136 const NAME: &'static str = "SCALED_PRESSURE2";
26137 const EXTRA_CRC: u8 = 195u8;
26138 const ENCODED_LEN: usize = 16usize;
26139 fn deser(
26140 _version: MavlinkVersion,
26141 __input: &[u8],
26142 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26143 let avail_len = __input.len();
26144 let mut payload_buf = [0; Self::ENCODED_LEN];
26145 let mut buf = if avail_len < Self::ENCODED_LEN {
26146 payload_buf[0..avail_len].copy_from_slice(__input);
26147 Bytes::new(&payload_buf)
26148 } else {
26149 Bytes::new(__input)
26150 };
26151 let mut __struct = Self::default();
26152 __struct.time_boot_ms = buf.get_u32_le();
26153 __struct.press_abs = buf.get_f32_le();
26154 __struct.press_diff = buf.get_f32_le();
26155 __struct.temperature = buf.get_i16_le();
26156 __struct.temperature_press_diff = buf.get_i16_le();
26157 Ok(__struct)
26158 }
26159 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26160 let mut __tmp = BytesMut::new(bytes);
26161 #[allow(clippy::absurd_extreme_comparisons)]
26162 #[allow(unused_comparisons)]
26163 if __tmp.remaining() < Self::ENCODED_LEN {
26164 panic!(
26165 "buffer is too small (need {} bytes, but got {})",
26166 Self::ENCODED_LEN,
26167 __tmp.remaining(),
26168 )
26169 }
26170 __tmp.put_u32_le(self.time_boot_ms);
26171 __tmp.put_f32_le(self.press_abs);
26172 __tmp.put_f32_le(self.press_diff);
26173 __tmp.put_i16_le(self.temperature);
26174 if matches!(version, MavlinkVersion::V2) {
26175 __tmp.put_i16_le(self.temperature_press_diff);
26176 let len = __tmp.len();
26177 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26178 } else {
26179 __tmp.len()
26180 }
26181 }
26182}
26183#[doc = "Barometer readings for 3rd barometer."]
26184#[doc = ""]
26185#[doc = "ID: 143"]
26186#[derive(Debug, Clone, PartialEq)]
26187#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26188#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26189pub struct SCALED_PRESSURE3_DATA {
26190 #[doc = "Timestamp (time since system boot)."]
26191 pub time_boot_ms: u32,
26192 #[doc = "Absolute pressure"]
26193 pub press_abs: f32,
26194 #[doc = "Differential pressure"]
26195 pub press_diff: f32,
26196 #[doc = "Absolute pressure temperature"]
26197 pub temperature: i16,
26198 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26199 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26200 pub temperature_press_diff: i16,
26201}
26202impl SCALED_PRESSURE3_DATA {
26203 pub const ENCODED_LEN: usize = 16usize;
26204 pub const DEFAULT: Self = Self {
26205 time_boot_ms: 0_u32,
26206 press_abs: 0.0_f32,
26207 press_diff: 0.0_f32,
26208 temperature: 0_i16,
26209 temperature_press_diff: 0_i16,
26210 };
26211 #[cfg(feature = "arbitrary")]
26212 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26213 use arbitrary::{Arbitrary, Unstructured};
26214 let mut buf = [0u8; 1024];
26215 rng.fill_bytes(&mut buf);
26216 let mut unstructured = Unstructured::new(&buf);
26217 Self::arbitrary(&mut unstructured).unwrap_or_default()
26218 }
26219}
26220impl Default for SCALED_PRESSURE3_DATA {
26221 fn default() -> Self {
26222 Self::DEFAULT.clone()
26223 }
26224}
26225impl MessageData for SCALED_PRESSURE3_DATA {
26226 type Message = MavMessage;
26227 const ID: u32 = 143u32;
26228 const NAME: &'static str = "SCALED_PRESSURE3";
26229 const EXTRA_CRC: u8 = 131u8;
26230 const ENCODED_LEN: usize = 16usize;
26231 fn deser(
26232 _version: MavlinkVersion,
26233 __input: &[u8],
26234 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26235 let avail_len = __input.len();
26236 let mut payload_buf = [0; Self::ENCODED_LEN];
26237 let mut buf = if avail_len < Self::ENCODED_LEN {
26238 payload_buf[0..avail_len].copy_from_slice(__input);
26239 Bytes::new(&payload_buf)
26240 } else {
26241 Bytes::new(__input)
26242 };
26243 let mut __struct = Self::default();
26244 __struct.time_boot_ms = buf.get_u32_le();
26245 __struct.press_abs = buf.get_f32_le();
26246 __struct.press_diff = buf.get_f32_le();
26247 __struct.temperature = buf.get_i16_le();
26248 __struct.temperature_press_diff = buf.get_i16_le();
26249 Ok(__struct)
26250 }
26251 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26252 let mut __tmp = BytesMut::new(bytes);
26253 #[allow(clippy::absurd_extreme_comparisons)]
26254 #[allow(unused_comparisons)]
26255 if __tmp.remaining() < Self::ENCODED_LEN {
26256 panic!(
26257 "buffer is too small (need {} bytes, but got {})",
26258 Self::ENCODED_LEN,
26259 __tmp.remaining(),
26260 )
26261 }
26262 __tmp.put_u32_le(self.time_boot_ms);
26263 __tmp.put_f32_le(self.press_abs);
26264 __tmp.put_f32_le(self.press_diff);
26265 __tmp.put_i16_le(self.temperature);
26266 if matches!(version, MavlinkVersion::V2) {
26267 __tmp.put_i16_le(self.temperature_press_diff);
26268 let len = __tmp.len();
26269 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26270 } else {
26271 __tmp.len()
26272 }
26273 }
26274}
26275#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
26276#[doc = ""]
26277#[doc = "ID: 126"]
26278#[derive(Debug, Clone, PartialEq)]
26279#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26280#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26281pub struct SERIAL_CONTROL_DATA {
26282 #[doc = "Baudrate of transfer. Zero means no change."]
26283 pub baudrate: u32,
26284 #[doc = "Timeout for reply data"]
26285 pub timeout: u16,
26286 #[doc = "Serial control device type."]
26287 pub device: SerialControlDev,
26288 #[doc = "Bitmap of serial control flags."]
26289 pub flags: SerialControlFlag,
26290 #[doc = "how many bytes in this transfer"]
26291 pub count: u8,
26292 #[doc = "serial data"]
26293 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26294 pub data: [u8; 70],
26295 #[doc = "System ID"]
26296 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26297 pub target_system: u8,
26298 #[doc = "Component ID"]
26299 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26300 pub target_component: u8,
26301}
26302impl SERIAL_CONTROL_DATA {
26303 pub const ENCODED_LEN: usize = 81usize;
26304 pub const DEFAULT: Self = Self {
26305 baudrate: 0_u32,
26306 timeout: 0_u16,
26307 device: SerialControlDev::DEFAULT,
26308 flags: SerialControlFlag::DEFAULT,
26309 count: 0_u8,
26310 data: [0_u8; 70usize],
26311 target_system: 0_u8,
26312 target_component: 0_u8,
26313 };
26314 #[cfg(feature = "arbitrary")]
26315 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26316 use arbitrary::{Arbitrary, Unstructured};
26317 let mut buf = [0u8; 1024];
26318 rng.fill_bytes(&mut buf);
26319 let mut unstructured = Unstructured::new(&buf);
26320 Self::arbitrary(&mut unstructured).unwrap_or_default()
26321 }
26322}
26323impl Default for SERIAL_CONTROL_DATA {
26324 fn default() -> Self {
26325 Self::DEFAULT.clone()
26326 }
26327}
26328impl MessageData for SERIAL_CONTROL_DATA {
26329 type Message = MavMessage;
26330 const ID: u32 = 126u32;
26331 const NAME: &'static str = "SERIAL_CONTROL";
26332 const EXTRA_CRC: u8 = 220u8;
26333 const ENCODED_LEN: usize = 81usize;
26334 fn deser(
26335 _version: MavlinkVersion,
26336 __input: &[u8],
26337 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26338 let avail_len = __input.len();
26339 let mut payload_buf = [0; Self::ENCODED_LEN];
26340 let mut buf = if avail_len < Self::ENCODED_LEN {
26341 payload_buf[0..avail_len].copy_from_slice(__input);
26342 Bytes::new(&payload_buf)
26343 } else {
26344 Bytes::new(__input)
26345 };
26346 let mut __struct = Self::default();
26347 __struct.baudrate = buf.get_u32_le();
26348 __struct.timeout = buf.get_u16_le();
26349 let tmp = buf.get_u8();
26350 __struct.device =
26351 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26352 enum_type: "SerialControlDev",
26353 value: tmp as u32,
26354 })?;
26355 let tmp = buf.get_u8();
26356 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
26357 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
26358 flag_type: "SerialControlFlag",
26359 value: tmp as u32,
26360 })?;
26361 __struct.count = buf.get_u8();
26362 for v in &mut __struct.data {
26363 let val = buf.get_u8();
26364 *v = val;
26365 }
26366 __struct.target_system = buf.get_u8();
26367 __struct.target_component = buf.get_u8();
26368 Ok(__struct)
26369 }
26370 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26371 let mut __tmp = BytesMut::new(bytes);
26372 #[allow(clippy::absurd_extreme_comparisons)]
26373 #[allow(unused_comparisons)]
26374 if __tmp.remaining() < Self::ENCODED_LEN {
26375 panic!(
26376 "buffer is too small (need {} bytes, but got {})",
26377 Self::ENCODED_LEN,
26378 __tmp.remaining(),
26379 )
26380 }
26381 __tmp.put_u32_le(self.baudrate);
26382 __tmp.put_u16_le(self.timeout);
26383 __tmp.put_u8(self.device as u8);
26384 __tmp.put_u8(self.flags.bits());
26385 __tmp.put_u8(self.count);
26386 for val in &self.data {
26387 __tmp.put_u8(*val);
26388 }
26389 if matches!(version, MavlinkVersion::V2) {
26390 __tmp.put_u8(self.target_system);
26391 __tmp.put_u8(self.target_component);
26392 let len = __tmp.len();
26393 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26394 } else {
26395 __tmp.len()
26396 }
26397 }
26398}
26399#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
26400#[doc = ""]
26401#[doc = "ID: 36"]
26402#[derive(Debug, Clone, PartialEq)]
26403#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26404#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26405pub struct SERVO_OUTPUT_RAW_DATA {
26406 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26407 pub time_usec: u32,
26408 #[doc = "Servo output 1 value"]
26409 pub servo1_raw: u16,
26410 #[doc = "Servo output 2 value"]
26411 pub servo2_raw: u16,
26412 #[doc = "Servo output 3 value"]
26413 pub servo3_raw: u16,
26414 #[doc = "Servo output 4 value"]
26415 pub servo4_raw: u16,
26416 #[doc = "Servo output 5 value"]
26417 pub servo5_raw: u16,
26418 #[doc = "Servo output 6 value"]
26419 pub servo6_raw: u16,
26420 #[doc = "Servo output 7 value"]
26421 pub servo7_raw: u16,
26422 #[doc = "Servo output 8 value"]
26423 pub servo8_raw: u16,
26424 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26425 pub port: u8,
26426 #[doc = "Servo output 9 value"]
26427 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26428 pub servo9_raw: u16,
26429 #[doc = "Servo output 10 value"]
26430 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26431 pub servo10_raw: u16,
26432 #[doc = "Servo output 11 value"]
26433 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26434 pub servo11_raw: u16,
26435 #[doc = "Servo output 12 value"]
26436 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26437 pub servo12_raw: u16,
26438 #[doc = "Servo output 13 value"]
26439 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26440 pub servo13_raw: u16,
26441 #[doc = "Servo output 14 value"]
26442 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26443 pub servo14_raw: u16,
26444 #[doc = "Servo output 15 value"]
26445 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26446 pub servo15_raw: u16,
26447 #[doc = "Servo output 16 value"]
26448 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26449 pub servo16_raw: u16,
26450}
26451impl SERVO_OUTPUT_RAW_DATA {
26452 pub const ENCODED_LEN: usize = 37usize;
26453 pub const DEFAULT: Self = Self {
26454 time_usec: 0_u32,
26455 servo1_raw: 0_u16,
26456 servo2_raw: 0_u16,
26457 servo3_raw: 0_u16,
26458 servo4_raw: 0_u16,
26459 servo5_raw: 0_u16,
26460 servo6_raw: 0_u16,
26461 servo7_raw: 0_u16,
26462 servo8_raw: 0_u16,
26463 port: 0_u8,
26464 servo9_raw: 0_u16,
26465 servo10_raw: 0_u16,
26466 servo11_raw: 0_u16,
26467 servo12_raw: 0_u16,
26468 servo13_raw: 0_u16,
26469 servo14_raw: 0_u16,
26470 servo15_raw: 0_u16,
26471 servo16_raw: 0_u16,
26472 };
26473 #[cfg(feature = "arbitrary")]
26474 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26475 use arbitrary::{Arbitrary, Unstructured};
26476 let mut buf = [0u8; 1024];
26477 rng.fill_bytes(&mut buf);
26478 let mut unstructured = Unstructured::new(&buf);
26479 Self::arbitrary(&mut unstructured).unwrap_or_default()
26480 }
26481}
26482impl Default for SERVO_OUTPUT_RAW_DATA {
26483 fn default() -> Self {
26484 Self::DEFAULT.clone()
26485 }
26486}
26487impl MessageData for SERVO_OUTPUT_RAW_DATA {
26488 type Message = MavMessage;
26489 const ID: u32 = 36u32;
26490 const NAME: &'static str = "SERVO_OUTPUT_RAW";
26491 const EXTRA_CRC: u8 = 222u8;
26492 const ENCODED_LEN: usize = 37usize;
26493 fn deser(
26494 _version: MavlinkVersion,
26495 __input: &[u8],
26496 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26497 let avail_len = __input.len();
26498 let mut payload_buf = [0; Self::ENCODED_LEN];
26499 let mut buf = if avail_len < Self::ENCODED_LEN {
26500 payload_buf[0..avail_len].copy_from_slice(__input);
26501 Bytes::new(&payload_buf)
26502 } else {
26503 Bytes::new(__input)
26504 };
26505 let mut __struct = Self::default();
26506 __struct.time_usec = buf.get_u32_le();
26507 __struct.servo1_raw = buf.get_u16_le();
26508 __struct.servo2_raw = buf.get_u16_le();
26509 __struct.servo3_raw = buf.get_u16_le();
26510 __struct.servo4_raw = buf.get_u16_le();
26511 __struct.servo5_raw = buf.get_u16_le();
26512 __struct.servo6_raw = buf.get_u16_le();
26513 __struct.servo7_raw = buf.get_u16_le();
26514 __struct.servo8_raw = buf.get_u16_le();
26515 __struct.port = buf.get_u8();
26516 __struct.servo9_raw = buf.get_u16_le();
26517 __struct.servo10_raw = buf.get_u16_le();
26518 __struct.servo11_raw = buf.get_u16_le();
26519 __struct.servo12_raw = buf.get_u16_le();
26520 __struct.servo13_raw = buf.get_u16_le();
26521 __struct.servo14_raw = buf.get_u16_le();
26522 __struct.servo15_raw = buf.get_u16_le();
26523 __struct.servo16_raw = buf.get_u16_le();
26524 Ok(__struct)
26525 }
26526 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26527 let mut __tmp = BytesMut::new(bytes);
26528 #[allow(clippy::absurd_extreme_comparisons)]
26529 #[allow(unused_comparisons)]
26530 if __tmp.remaining() < Self::ENCODED_LEN {
26531 panic!(
26532 "buffer is too small (need {} bytes, but got {})",
26533 Self::ENCODED_LEN,
26534 __tmp.remaining(),
26535 )
26536 }
26537 __tmp.put_u32_le(self.time_usec);
26538 __tmp.put_u16_le(self.servo1_raw);
26539 __tmp.put_u16_le(self.servo2_raw);
26540 __tmp.put_u16_le(self.servo3_raw);
26541 __tmp.put_u16_le(self.servo4_raw);
26542 __tmp.put_u16_le(self.servo5_raw);
26543 __tmp.put_u16_le(self.servo6_raw);
26544 __tmp.put_u16_le(self.servo7_raw);
26545 __tmp.put_u16_le(self.servo8_raw);
26546 __tmp.put_u8(self.port);
26547 if matches!(version, MavlinkVersion::V2) {
26548 __tmp.put_u16_le(self.servo9_raw);
26549 __tmp.put_u16_le(self.servo10_raw);
26550 __tmp.put_u16_le(self.servo11_raw);
26551 __tmp.put_u16_le(self.servo12_raw);
26552 __tmp.put_u16_le(self.servo13_raw);
26553 __tmp.put_u16_le(self.servo14_raw);
26554 __tmp.put_u16_le(self.servo15_raw);
26555 __tmp.put_u16_le(self.servo16_raw);
26556 let len = __tmp.len();
26557 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26558 } else {
26559 __tmp.len()
26560 }
26561 }
26562}
26563#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
26564#[doc = ""]
26565#[doc = "ID: 256"]
26566#[derive(Debug, Clone, PartialEq)]
26567#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26568#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26569pub struct SETUP_SIGNING_DATA {
26570 #[doc = "initial timestamp"]
26571 pub initial_timestamp: u64,
26572 #[doc = "system id of the target"]
26573 pub target_system: u8,
26574 #[doc = "component ID of the target"]
26575 pub target_component: u8,
26576 #[doc = "signing key"]
26577 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26578 pub secret_key: [u8; 32],
26579}
26580impl SETUP_SIGNING_DATA {
26581 pub const ENCODED_LEN: usize = 42usize;
26582 pub const DEFAULT: Self = Self {
26583 initial_timestamp: 0_u64,
26584 target_system: 0_u8,
26585 target_component: 0_u8,
26586 secret_key: [0_u8; 32usize],
26587 };
26588 #[cfg(feature = "arbitrary")]
26589 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26590 use arbitrary::{Arbitrary, Unstructured};
26591 let mut buf = [0u8; 1024];
26592 rng.fill_bytes(&mut buf);
26593 let mut unstructured = Unstructured::new(&buf);
26594 Self::arbitrary(&mut unstructured).unwrap_or_default()
26595 }
26596}
26597impl Default for SETUP_SIGNING_DATA {
26598 fn default() -> Self {
26599 Self::DEFAULT.clone()
26600 }
26601}
26602impl MessageData for SETUP_SIGNING_DATA {
26603 type Message = MavMessage;
26604 const ID: u32 = 256u32;
26605 const NAME: &'static str = "SETUP_SIGNING";
26606 const EXTRA_CRC: u8 = 71u8;
26607 const ENCODED_LEN: usize = 42usize;
26608 fn deser(
26609 _version: MavlinkVersion,
26610 __input: &[u8],
26611 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26612 let avail_len = __input.len();
26613 let mut payload_buf = [0; Self::ENCODED_LEN];
26614 let mut buf = if avail_len < Self::ENCODED_LEN {
26615 payload_buf[0..avail_len].copy_from_slice(__input);
26616 Bytes::new(&payload_buf)
26617 } else {
26618 Bytes::new(__input)
26619 };
26620 let mut __struct = Self::default();
26621 __struct.initial_timestamp = buf.get_u64_le();
26622 __struct.target_system = buf.get_u8();
26623 __struct.target_component = buf.get_u8();
26624 for v in &mut __struct.secret_key {
26625 let val = buf.get_u8();
26626 *v = val;
26627 }
26628 Ok(__struct)
26629 }
26630 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26631 let mut __tmp = BytesMut::new(bytes);
26632 #[allow(clippy::absurd_extreme_comparisons)]
26633 #[allow(unused_comparisons)]
26634 if __tmp.remaining() < Self::ENCODED_LEN {
26635 panic!(
26636 "buffer is too small (need {} bytes, but got {})",
26637 Self::ENCODED_LEN,
26638 __tmp.remaining(),
26639 )
26640 }
26641 __tmp.put_u64_le(self.initial_timestamp);
26642 __tmp.put_u8(self.target_system);
26643 __tmp.put_u8(self.target_component);
26644 for val in &self.secret_key {
26645 __tmp.put_u8(*val);
26646 }
26647 if matches!(version, MavlinkVersion::V2) {
26648 let len = __tmp.len();
26649 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26650 } else {
26651 __tmp.len()
26652 }
26653 }
26654}
26655#[doc = "Set the vehicle attitude and body angular rates."]
26656#[doc = ""]
26657#[doc = "ID: 139"]
26658#[derive(Debug, Clone, PartialEq)]
26659#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26660#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26661pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
26662 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26663 pub time_usec: u64,
26664 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
26665 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26666 pub controls: [f32; 8],
26667 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
26668 pub group_mlx: u8,
26669 #[doc = "System ID"]
26670 pub target_system: u8,
26671 #[doc = "Component ID"]
26672 pub target_component: u8,
26673}
26674impl SET_ACTUATOR_CONTROL_TARGET_DATA {
26675 pub const ENCODED_LEN: usize = 43usize;
26676 pub const DEFAULT: Self = Self {
26677 time_usec: 0_u64,
26678 controls: [0.0_f32; 8usize],
26679 group_mlx: 0_u8,
26680 target_system: 0_u8,
26681 target_component: 0_u8,
26682 };
26683 #[cfg(feature = "arbitrary")]
26684 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26685 use arbitrary::{Arbitrary, Unstructured};
26686 let mut buf = [0u8; 1024];
26687 rng.fill_bytes(&mut buf);
26688 let mut unstructured = Unstructured::new(&buf);
26689 Self::arbitrary(&mut unstructured).unwrap_or_default()
26690 }
26691}
26692impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
26693 fn default() -> Self {
26694 Self::DEFAULT.clone()
26695 }
26696}
26697impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
26698 type Message = MavMessage;
26699 const ID: u32 = 139u32;
26700 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
26701 const EXTRA_CRC: u8 = 168u8;
26702 const ENCODED_LEN: usize = 43usize;
26703 fn deser(
26704 _version: MavlinkVersion,
26705 __input: &[u8],
26706 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26707 let avail_len = __input.len();
26708 let mut payload_buf = [0; Self::ENCODED_LEN];
26709 let mut buf = if avail_len < Self::ENCODED_LEN {
26710 payload_buf[0..avail_len].copy_from_slice(__input);
26711 Bytes::new(&payload_buf)
26712 } else {
26713 Bytes::new(__input)
26714 };
26715 let mut __struct = Self::default();
26716 __struct.time_usec = buf.get_u64_le();
26717 for v in &mut __struct.controls {
26718 let val = buf.get_f32_le();
26719 *v = val;
26720 }
26721 __struct.group_mlx = buf.get_u8();
26722 __struct.target_system = buf.get_u8();
26723 __struct.target_component = buf.get_u8();
26724 Ok(__struct)
26725 }
26726 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26727 let mut __tmp = BytesMut::new(bytes);
26728 #[allow(clippy::absurd_extreme_comparisons)]
26729 #[allow(unused_comparisons)]
26730 if __tmp.remaining() < Self::ENCODED_LEN {
26731 panic!(
26732 "buffer is too small (need {} bytes, but got {})",
26733 Self::ENCODED_LEN,
26734 __tmp.remaining(),
26735 )
26736 }
26737 __tmp.put_u64_le(self.time_usec);
26738 for val in &self.controls {
26739 __tmp.put_f32_le(*val);
26740 }
26741 __tmp.put_u8(self.group_mlx);
26742 __tmp.put_u8(self.target_system);
26743 __tmp.put_u8(self.target_component);
26744 if matches!(version, MavlinkVersion::V2) {
26745 let len = __tmp.len();
26746 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26747 } else {
26748 __tmp.len()
26749 }
26750 }
26751}
26752#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
26753#[doc = ""]
26754#[doc = "ID: 82"]
26755#[derive(Debug, Clone, PartialEq)]
26756#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26757#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26758pub struct SET_ATTITUDE_TARGET_DATA {
26759 #[doc = "Timestamp (time since system boot)."]
26760 pub time_boot_ms: u32,
26761 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
26762 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26763 pub q: [f32; 4],
26764 #[doc = "Body roll rate"]
26765 pub body_roll_rate: f32,
26766 #[doc = "Body pitch rate"]
26767 pub body_pitch_rate: f32,
26768 #[doc = "Body yaw rate"]
26769 pub body_yaw_rate: f32,
26770 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
26771 pub thrust: f32,
26772 #[doc = "System ID"]
26773 pub target_system: u8,
26774 #[doc = "Component ID"]
26775 pub target_component: u8,
26776 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
26777 pub type_mask: AttitudeTargetTypemask,
26778 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
26779 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26780 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26781 pub thrust_body: [f32; 3],
26782}
26783impl SET_ATTITUDE_TARGET_DATA {
26784 pub const ENCODED_LEN: usize = 51usize;
26785 pub const DEFAULT: Self = Self {
26786 time_boot_ms: 0_u32,
26787 q: [0.0_f32; 4usize],
26788 body_roll_rate: 0.0_f32,
26789 body_pitch_rate: 0.0_f32,
26790 body_yaw_rate: 0.0_f32,
26791 thrust: 0.0_f32,
26792 target_system: 0_u8,
26793 target_component: 0_u8,
26794 type_mask: AttitudeTargetTypemask::DEFAULT,
26795 thrust_body: [0.0_f32; 3usize],
26796 };
26797 #[cfg(feature = "arbitrary")]
26798 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26799 use arbitrary::{Arbitrary, Unstructured};
26800 let mut buf = [0u8; 1024];
26801 rng.fill_bytes(&mut buf);
26802 let mut unstructured = Unstructured::new(&buf);
26803 Self::arbitrary(&mut unstructured).unwrap_or_default()
26804 }
26805}
26806impl Default for SET_ATTITUDE_TARGET_DATA {
26807 fn default() -> Self {
26808 Self::DEFAULT.clone()
26809 }
26810}
26811impl MessageData for SET_ATTITUDE_TARGET_DATA {
26812 type Message = MavMessage;
26813 const ID: u32 = 82u32;
26814 const NAME: &'static str = "SET_ATTITUDE_TARGET";
26815 const EXTRA_CRC: u8 = 49u8;
26816 const ENCODED_LEN: usize = 51usize;
26817 fn deser(
26818 _version: MavlinkVersion,
26819 __input: &[u8],
26820 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26821 let avail_len = __input.len();
26822 let mut payload_buf = [0; Self::ENCODED_LEN];
26823 let mut buf = if avail_len < Self::ENCODED_LEN {
26824 payload_buf[0..avail_len].copy_from_slice(__input);
26825 Bytes::new(&payload_buf)
26826 } else {
26827 Bytes::new(__input)
26828 };
26829 let mut __struct = Self::default();
26830 __struct.time_boot_ms = buf.get_u32_le();
26831 for v in &mut __struct.q {
26832 let val = buf.get_f32_le();
26833 *v = val;
26834 }
26835 __struct.body_roll_rate = buf.get_f32_le();
26836 __struct.body_pitch_rate = buf.get_f32_le();
26837 __struct.body_yaw_rate = buf.get_f32_le();
26838 __struct.thrust = buf.get_f32_le();
26839 __struct.target_system = buf.get_u8();
26840 __struct.target_component = buf.get_u8();
26841 let tmp = buf.get_u8();
26842 __struct.type_mask = AttitudeTargetTypemask::from_bits(
26843 tmp & AttitudeTargetTypemask::all().bits(),
26844 )
26845 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
26846 flag_type: "AttitudeTargetTypemask",
26847 value: tmp as u32,
26848 })?;
26849 for v in &mut __struct.thrust_body {
26850 let val = buf.get_f32_le();
26851 *v = val;
26852 }
26853 Ok(__struct)
26854 }
26855 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26856 let mut __tmp = BytesMut::new(bytes);
26857 #[allow(clippy::absurd_extreme_comparisons)]
26858 #[allow(unused_comparisons)]
26859 if __tmp.remaining() < Self::ENCODED_LEN {
26860 panic!(
26861 "buffer is too small (need {} bytes, but got {})",
26862 Self::ENCODED_LEN,
26863 __tmp.remaining(),
26864 )
26865 }
26866 __tmp.put_u32_le(self.time_boot_ms);
26867 for val in &self.q {
26868 __tmp.put_f32_le(*val);
26869 }
26870 __tmp.put_f32_le(self.body_roll_rate);
26871 __tmp.put_f32_le(self.body_pitch_rate);
26872 __tmp.put_f32_le(self.body_yaw_rate);
26873 __tmp.put_f32_le(self.thrust);
26874 __tmp.put_u8(self.target_system);
26875 __tmp.put_u8(self.target_component);
26876 __tmp.put_u8(self.type_mask.bits());
26877 if matches!(version, MavlinkVersion::V2) {
26878 for val in &self.thrust_body {
26879 __tmp.put_f32_le(*val);
26880 }
26881 let len = __tmp.len();
26882 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26883 } else {
26884 __tmp.len()
26885 }
26886 }
26887}
26888#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
26889#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
26890#[doc = ""]
26891#[doc = "ID: 48"]
26892#[derive(Debug, Clone, PartialEq)]
26893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26894#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26895pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
26896 #[doc = "Latitude (WGS84)"]
26897 pub latitude: i32,
26898 #[doc = "Longitude (WGS84)"]
26899 pub longitude: i32,
26900 #[doc = "Altitude (MSL). Positive for up."]
26901 pub altitude: i32,
26902 #[doc = "System ID"]
26903 pub target_system: u8,
26904 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26905 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26906 pub time_usec: u64,
26907}
26908impl SET_GPS_GLOBAL_ORIGIN_DATA {
26909 pub const ENCODED_LEN: usize = 21usize;
26910 pub const DEFAULT: Self = Self {
26911 latitude: 0_i32,
26912 longitude: 0_i32,
26913 altitude: 0_i32,
26914 target_system: 0_u8,
26915 time_usec: 0_u64,
26916 };
26917 #[cfg(feature = "arbitrary")]
26918 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26919 use arbitrary::{Arbitrary, Unstructured};
26920 let mut buf = [0u8; 1024];
26921 rng.fill_bytes(&mut buf);
26922 let mut unstructured = Unstructured::new(&buf);
26923 Self::arbitrary(&mut unstructured).unwrap_or_default()
26924 }
26925}
26926impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
26927 fn default() -> Self {
26928 Self::DEFAULT.clone()
26929 }
26930}
26931impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
26932 type Message = MavMessage;
26933 const ID: u32 = 48u32;
26934 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
26935 const EXTRA_CRC: u8 = 41u8;
26936 const ENCODED_LEN: usize = 21usize;
26937 fn deser(
26938 _version: MavlinkVersion,
26939 __input: &[u8],
26940 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26941 let avail_len = __input.len();
26942 let mut payload_buf = [0; Self::ENCODED_LEN];
26943 let mut buf = if avail_len < Self::ENCODED_LEN {
26944 payload_buf[0..avail_len].copy_from_slice(__input);
26945 Bytes::new(&payload_buf)
26946 } else {
26947 Bytes::new(__input)
26948 };
26949 let mut __struct = Self::default();
26950 __struct.latitude = buf.get_i32_le();
26951 __struct.longitude = buf.get_i32_le();
26952 __struct.altitude = buf.get_i32_le();
26953 __struct.target_system = buf.get_u8();
26954 __struct.time_usec = buf.get_u64_le();
26955 Ok(__struct)
26956 }
26957 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26958 let mut __tmp = BytesMut::new(bytes);
26959 #[allow(clippy::absurd_extreme_comparisons)]
26960 #[allow(unused_comparisons)]
26961 if __tmp.remaining() < Self::ENCODED_LEN {
26962 panic!(
26963 "buffer is too small (need {} bytes, but got {})",
26964 Self::ENCODED_LEN,
26965 __tmp.remaining(),
26966 )
26967 }
26968 __tmp.put_i32_le(self.latitude);
26969 __tmp.put_i32_le(self.longitude);
26970 __tmp.put_i32_le(self.altitude);
26971 __tmp.put_u8(self.target_system);
26972 if matches!(version, MavlinkVersion::V2) {
26973 __tmp.put_u64_le(self.time_usec);
26974 let len = __tmp.len();
26975 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26976 } else {
26977 __tmp.len()
26978 }
26979 }
26980}
26981#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
26982#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
26983#[doc = ""]
26984#[doc = "ID: 243"]
26985#[derive(Debug, Clone, PartialEq)]
26986#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26987#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26988pub struct SET_HOME_POSITION_DATA {
26989 #[doc = "Latitude (WGS84)"]
26990 pub latitude: i32,
26991 #[doc = "Longitude (WGS84)"]
26992 pub longitude: i32,
26993 #[doc = "Altitude (MSL). Positive for up."]
26994 pub altitude: i32,
26995 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
26996 pub x: f32,
26997 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
26998 pub y: f32,
26999 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
27000 pub z: f32,
27001 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
27002 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27003 pub q: [f32; 4],
27004 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27005 pub approach_x: f32,
27006 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27007 pub approach_y: f32,
27008 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27009 pub approach_z: f32,
27010 #[doc = "System ID."]
27011 pub target_system: u8,
27012 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27013 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27014 pub time_usec: u64,
27015}
27016impl SET_HOME_POSITION_DATA {
27017 pub const ENCODED_LEN: usize = 61usize;
27018 pub const DEFAULT: Self = Self {
27019 latitude: 0_i32,
27020 longitude: 0_i32,
27021 altitude: 0_i32,
27022 x: 0.0_f32,
27023 y: 0.0_f32,
27024 z: 0.0_f32,
27025 q: [0.0_f32; 4usize],
27026 approach_x: 0.0_f32,
27027 approach_y: 0.0_f32,
27028 approach_z: 0.0_f32,
27029 target_system: 0_u8,
27030 time_usec: 0_u64,
27031 };
27032 #[cfg(feature = "arbitrary")]
27033 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27034 use arbitrary::{Arbitrary, Unstructured};
27035 let mut buf = [0u8; 1024];
27036 rng.fill_bytes(&mut buf);
27037 let mut unstructured = Unstructured::new(&buf);
27038 Self::arbitrary(&mut unstructured).unwrap_or_default()
27039 }
27040}
27041impl Default for SET_HOME_POSITION_DATA {
27042 fn default() -> Self {
27043 Self::DEFAULT.clone()
27044 }
27045}
27046impl MessageData for SET_HOME_POSITION_DATA {
27047 type Message = MavMessage;
27048 const ID: u32 = 243u32;
27049 const NAME: &'static str = "SET_HOME_POSITION";
27050 const EXTRA_CRC: u8 = 85u8;
27051 const ENCODED_LEN: usize = 61usize;
27052 fn deser(
27053 _version: MavlinkVersion,
27054 __input: &[u8],
27055 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27056 let avail_len = __input.len();
27057 let mut payload_buf = [0; Self::ENCODED_LEN];
27058 let mut buf = if avail_len < Self::ENCODED_LEN {
27059 payload_buf[0..avail_len].copy_from_slice(__input);
27060 Bytes::new(&payload_buf)
27061 } else {
27062 Bytes::new(__input)
27063 };
27064 let mut __struct = Self::default();
27065 __struct.latitude = buf.get_i32_le();
27066 __struct.longitude = buf.get_i32_le();
27067 __struct.altitude = buf.get_i32_le();
27068 __struct.x = buf.get_f32_le();
27069 __struct.y = buf.get_f32_le();
27070 __struct.z = buf.get_f32_le();
27071 for v in &mut __struct.q {
27072 let val = buf.get_f32_le();
27073 *v = val;
27074 }
27075 __struct.approach_x = buf.get_f32_le();
27076 __struct.approach_y = buf.get_f32_le();
27077 __struct.approach_z = buf.get_f32_le();
27078 __struct.target_system = buf.get_u8();
27079 __struct.time_usec = buf.get_u64_le();
27080 Ok(__struct)
27081 }
27082 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27083 let mut __tmp = BytesMut::new(bytes);
27084 #[allow(clippy::absurd_extreme_comparisons)]
27085 #[allow(unused_comparisons)]
27086 if __tmp.remaining() < Self::ENCODED_LEN {
27087 panic!(
27088 "buffer is too small (need {} bytes, but got {})",
27089 Self::ENCODED_LEN,
27090 __tmp.remaining(),
27091 )
27092 }
27093 __tmp.put_i32_le(self.latitude);
27094 __tmp.put_i32_le(self.longitude);
27095 __tmp.put_i32_le(self.altitude);
27096 __tmp.put_f32_le(self.x);
27097 __tmp.put_f32_le(self.y);
27098 __tmp.put_f32_le(self.z);
27099 for val in &self.q {
27100 __tmp.put_f32_le(*val);
27101 }
27102 __tmp.put_f32_le(self.approach_x);
27103 __tmp.put_f32_le(self.approach_y);
27104 __tmp.put_f32_le(self.approach_z);
27105 __tmp.put_u8(self.target_system);
27106 if matches!(version, MavlinkVersion::V2) {
27107 __tmp.put_u64_le(self.time_usec);
27108 let len = __tmp.len();
27109 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27110 } else {
27111 __tmp.len()
27112 }
27113 }
27114}
27115#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
27116#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
27117#[doc = ""]
27118#[doc = "ID: 11"]
27119#[derive(Debug, Clone, PartialEq)]
27120#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27121#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27122pub struct SET_MODE_DATA {
27123 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
27124 pub custom_mode: u32,
27125 #[doc = "The system setting the mode"]
27126 pub target_system: u8,
27127 #[doc = "The new base mode."]
27128 pub base_mode: MavMode,
27129}
27130impl SET_MODE_DATA {
27131 pub const ENCODED_LEN: usize = 6usize;
27132 pub const DEFAULT: Self = Self {
27133 custom_mode: 0_u32,
27134 target_system: 0_u8,
27135 base_mode: MavMode::DEFAULT,
27136 };
27137 #[cfg(feature = "arbitrary")]
27138 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27139 use arbitrary::{Arbitrary, Unstructured};
27140 let mut buf = [0u8; 1024];
27141 rng.fill_bytes(&mut buf);
27142 let mut unstructured = Unstructured::new(&buf);
27143 Self::arbitrary(&mut unstructured).unwrap_or_default()
27144 }
27145}
27146impl Default for SET_MODE_DATA {
27147 fn default() -> Self {
27148 Self::DEFAULT.clone()
27149 }
27150}
27151impl MessageData for SET_MODE_DATA {
27152 type Message = MavMessage;
27153 const ID: u32 = 11u32;
27154 const NAME: &'static str = "SET_MODE";
27155 const EXTRA_CRC: u8 = 89u8;
27156 const ENCODED_LEN: usize = 6usize;
27157 fn deser(
27158 _version: MavlinkVersion,
27159 __input: &[u8],
27160 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27161 let avail_len = __input.len();
27162 let mut payload_buf = [0; Self::ENCODED_LEN];
27163 let mut buf = if avail_len < Self::ENCODED_LEN {
27164 payload_buf[0..avail_len].copy_from_slice(__input);
27165 Bytes::new(&payload_buf)
27166 } else {
27167 Bytes::new(__input)
27168 };
27169 let mut __struct = Self::default();
27170 __struct.custom_mode = buf.get_u32_le();
27171 __struct.target_system = buf.get_u8();
27172 let tmp = buf.get_u8();
27173 __struct.base_mode =
27174 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27175 enum_type: "MavMode",
27176 value: tmp as u32,
27177 })?;
27178 Ok(__struct)
27179 }
27180 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27181 let mut __tmp = BytesMut::new(bytes);
27182 #[allow(clippy::absurd_extreme_comparisons)]
27183 #[allow(unused_comparisons)]
27184 if __tmp.remaining() < Self::ENCODED_LEN {
27185 panic!(
27186 "buffer is too small (need {} bytes, but got {})",
27187 Self::ENCODED_LEN,
27188 __tmp.remaining(),
27189 )
27190 }
27191 __tmp.put_u32_le(self.custom_mode);
27192 __tmp.put_u8(self.target_system);
27193 __tmp.put_u8(self.base_mode as u8);
27194 if matches!(version, MavlinkVersion::V2) {
27195 let len = __tmp.len();
27196 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27197 } else {
27198 __tmp.len()
27199 }
27200 }
27201}
27202#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
27203#[doc = ""]
27204#[doc = "ID: 86"]
27205#[derive(Debug, Clone, PartialEq)]
27206#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27207#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27208pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
27209 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
27210 pub time_boot_ms: u32,
27211 #[doc = "Latitude in WGS84 frame"]
27212 pub lat_int: i32,
27213 #[doc = "Longitude in WGS84 frame"]
27214 pub lon_int: i32,
27215 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
27216 pub alt: f32,
27217 #[doc = "X velocity in NED frame"]
27218 pub vx: f32,
27219 #[doc = "Y velocity in NED frame"]
27220 pub vy: f32,
27221 #[doc = "Z velocity in NED frame"]
27222 pub vz: f32,
27223 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27224 pub afx: f32,
27225 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27226 pub afy: f32,
27227 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27228 pub afz: f32,
27229 #[doc = "yaw setpoint"]
27230 pub yaw: f32,
27231 #[doc = "yaw rate setpoint"]
27232 pub yaw_rate: f32,
27233 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27234 pub type_mask: PositionTargetTypemask,
27235 #[doc = "System ID"]
27236 pub target_system: u8,
27237 #[doc = "Component ID"]
27238 pub target_component: u8,
27239 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
27240 pub coordinate_frame: MavFrame,
27241}
27242impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
27243 pub const ENCODED_LEN: usize = 53usize;
27244 pub const DEFAULT: Self = Self {
27245 time_boot_ms: 0_u32,
27246 lat_int: 0_i32,
27247 lon_int: 0_i32,
27248 alt: 0.0_f32,
27249 vx: 0.0_f32,
27250 vy: 0.0_f32,
27251 vz: 0.0_f32,
27252 afx: 0.0_f32,
27253 afy: 0.0_f32,
27254 afz: 0.0_f32,
27255 yaw: 0.0_f32,
27256 yaw_rate: 0.0_f32,
27257 type_mask: PositionTargetTypemask::DEFAULT,
27258 target_system: 0_u8,
27259 target_component: 0_u8,
27260 coordinate_frame: MavFrame::DEFAULT,
27261 };
27262 #[cfg(feature = "arbitrary")]
27263 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27264 use arbitrary::{Arbitrary, Unstructured};
27265 let mut buf = [0u8; 1024];
27266 rng.fill_bytes(&mut buf);
27267 let mut unstructured = Unstructured::new(&buf);
27268 Self::arbitrary(&mut unstructured).unwrap_or_default()
27269 }
27270}
27271impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27272 fn default() -> Self {
27273 Self::DEFAULT.clone()
27274 }
27275}
27276impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27277 type Message = MavMessage;
27278 const ID: u32 = 86u32;
27279 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
27280 const EXTRA_CRC: u8 = 5u8;
27281 const ENCODED_LEN: usize = 53usize;
27282 fn deser(
27283 _version: MavlinkVersion,
27284 __input: &[u8],
27285 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27286 let avail_len = __input.len();
27287 let mut payload_buf = [0; Self::ENCODED_LEN];
27288 let mut buf = if avail_len < Self::ENCODED_LEN {
27289 payload_buf[0..avail_len].copy_from_slice(__input);
27290 Bytes::new(&payload_buf)
27291 } else {
27292 Bytes::new(__input)
27293 };
27294 let mut __struct = Self::default();
27295 __struct.time_boot_ms = buf.get_u32_le();
27296 __struct.lat_int = buf.get_i32_le();
27297 __struct.lon_int = buf.get_i32_le();
27298 __struct.alt = buf.get_f32_le();
27299 __struct.vx = buf.get_f32_le();
27300 __struct.vy = buf.get_f32_le();
27301 __struct.vz = buf.get_f32_le();
27302 __struct.afx = buf.get_f32_le();
27303 __struct.afy = buf.get_f32_le();
27304 __struct.afz = buf.get_f32_le();
27305 __struct.yaw = buf.get_f32_le();
27306 __struct.yaw_rate = buf.get_f32_le();
27307 let tmp = buf.get_u16_le();
27308 __struct.type_mask = PositionTargetTypemask::from_bits(
27309 tmp & PositionTargetTypemask::all().bits(),
27310 )
27311 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27312 flag_type: "PositionTargetTypemask",
27313 value: tmp as u32,
27314 })?;
27315 __struct.target_system = buf.get_u8();
27316 __struct.target_component = buf.get_u8();
27317 let tmp = buf.get_u8();
27318 __struct.coordinate_frame =
27319 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27320 enum_type: "MavFrame",
27321 value: tmp as u32,
27322 })?;
27323 Ok(__struct)
27324 }
27325 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27326 let mut __tmp = BytesMut::new(bytes);
27327 #[allow(clippy::absurd_extreme_comparisons)]
27328 #[allow(unused_comparisons)]
27329 if __tmp.remaining() < Self::ENCODED_LEN {
27330 panic!(
27331 "buffer is too small (need {} bytes, but got {})",
27332 Self::ENCODED_LEN,
27333 __tmp.remaining(),
27334 )
27335 }
27336 __tmp.put_u32_le(self.time_boot_ms);
27337 __tmp.put_i32_le(self.lat_int);
27338 __tmp.put_i32_le(self.lon_int);
27339 __tmp.put_f32_le(self.alt);
27340 __tmp.put_f32_le(self.vx);
27341 __tmp.put_f32_le(self.vy);
27342 __tmp.put_f32_le(self.vz);
27343 __tmp.put_f32_le(self.afx);
27344 __tmp.put_f32_le(self.afy);
27345 __tmp.put_f32_le(self.afz);
27346 __tmp.put_f32_le(self.yaw);
27347 __tmp.put_f32_le(self.yaw_rate);
27348 __tmp.put_u16_le(self.type_mask.bits());
27349 __tmp.put_u8(self.target_system);
27350 __tmp.put_u8(self.target_component);
27351 __tmp.put_u8(self.coordinate_frame as u8);
27352 if matches!(version, MavlinkVersion::V2) {
27353 let len = __tmp.len();
27354 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27355 } else {
27356 __tmp.len()
27357 }
27358 }
27359}
27360#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
27361#[doc = ""]
27362#[doc = "ID: 84"]
27363#[derive(Debug, Clone, PartialEq)]
27364#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27366pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
27367 #[doc = "Timestamp (time since system boot)."]
27368 pub time_boot_ms: u32,
27369 #[doc = "X Position in NED frame"]
27370 pub x: f32,
27371 #[doc = "Y Position in NED frame"]
27372 pub y: f32,
27373 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
27374 pub z: f32,
27375 #[doc = "X velocity in NED frame"]
27376 pub vx: f32,
27377 #[doc = "Y velocity in NED frame"]
27378 pub vy: f32,
27379 #[doc = "Z velocity in NED frame"]
27380 pub vz: f32,
27381 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27382 pub afx: f32,
27383 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27384 pub afy: f32,
27385 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27386 pub afz: f32,
27387 #[doc = "yaw setpoint"]
27388 pub yaw: f32,
27389 #[doc = "yaw rate setpoint"]
27390 pub yaw_rate: f32,
27391 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27392 pub type_mask: PositionTargetTypemask,
27393 #[doc = "System ID"]
27394 pub target_system: u8,
27395 #[doc = "Component ID"]
27396 pub target_component: u8,
27397 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
27398 pub coordinate_frame: MavFrame,
27399}
27400impl SET_POSITION_TARGET_LOCAL_NED_DATA {
27401 pub const ENCODED_LEN: usize = 53usize;
27402 pub const DEFAULT: Self = Self {
27403 time_boot_ms: 0_u32,
27404 x: 0.0_f32,
27405 y: 0.0_f32,
27406 z: 0.0_f32,
27407 vx: 0.0_f32,
27408 vy: 0.0_f32,
27409 vz: 0.0_f32,
27410 afx: 0.0_f32,
27411 afy: 0.0_f32,
27412 afz: 0.0_f32,
27413 yaw: 0.0_f32,
27414 yaw_rate: 0.0_f32,
27415 type_mask: PositionTargetTypemask::DEFAULT,
27416 target_system: 0_u8,
27417 target_component: 0_u8,
27418 coordinate_frame: MavFrame::DEFAULT,
27419 };
27420 #[cfg(feature = "arbitrary")]
27421 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27422 use arbitrary::{Arbitrary, Unstructured};
27423 let mut buf = [0u8; 1024];
27424 rng.fill_bytes(&mut buf);
27425 let mut unstructured = Unstructured::new(&buf);
27426 Self::arbitrary(&mut unstructured).unwrap_or_default()
27427 }
27428}
27429impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
27430 fn default() -> Self {
27431 Self::DEFAULT.clone()
27432 }
27433}
27434impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
27435 type Message = MavMessage;
27436 const ID: u32 = 84u32;
27437 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
27438 const EXTRA_CRC: u8 = 143u8;
27439 const ENCODED_LEN: usize = 53usize;
27440 fn deser(
27441 _version: MavlinkVersion,
27442 __input: &[u8],
27443 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27444 let avail_len = __input.len();
27445 let mut payload_buf = [0; Self::ENCODED_LEN];
27446 let mut buf = if avail_len < Self::ENCODED_LEN {
27447 payload_buf[0..avail_len].copy_from_slice(__input);
27448 Bytes::new(&payload_buf)
27449 } else {
27450 Bytes::new(__input)
27451 };
27452 let mut __struct = Self::default();
27453 __struct.time_boot_ms = buf.get_u32_le();
27454 __struct.x = buf.get_f32_le();
27455 __struct.y = buf.get_f32_le();
27456 __struct.z = buf.get_f32_le();
27457 __struct.vx = buf.get_f32_le();
27458 __struct.vy = buf.get_f32_le();
27459 __struct.vz = buf.get_f32_le();
27460 __struct.afx = buf.get_f32_le();
27461 __struct.afy = buf.get_f32_le();
27462 __struct.afz = buf.get_f32_le();
27463 __struct.yaw = buf.get_f32_le();
27464 __struct.yaw_rate = buf.get_f32_le();
27465 let tmp = buf.get_u16_le();
27466 __struct.type_mask = PositionTargetTypemask::from_bits(
27467 tmp & PositionTargetTypemask::all().bits(),
27468 )
27469 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27470 flag_type: "PositionTargetTypemask",
27471 value: tmp as u32,
27472 })?;
27473 __struct.target_system = buf.get_u8();
27474 __struct.target_component = buf.get_u8();
27475 let tmp = buf.get_u8();
27476 __struct.coordinate_frame =
27477 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27478 enum_type: "MavFrame",
27479 value: tmp as u32,
27480 })?;
27481 Ok(__struct)
27482 }
27483 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27484 let mut __tmp = BytesMut::new(bytes);
27485 #[allow(clippy::absurd_extreme_comparisons)]
27486 #[allow(unused_comparisons)]
27487 if __tmp.remaining() < Self::ENCODED_LEN {
27488 panic!(
27489 "buffer is too small (need {} bytes, but got {})",
27490 Self::ENCODED_LEN,
27491 __tmp.remaining(),
27492 )
27493 }
27494 __tmp.put_u32_le(self.time_boot_ms);
27495 __tmp.put_f32_le(self.x);
27496 __tmp.put_f32_le(self.y);
27497 __tmp.put_f32_le(self.z);
27498 __tmp.put_f32_le(self.vx);
27499 __tmp.put_f32_le(self.vy);
27500 __tmp.put_f32_le(self.vz);
27501 __tmp.put_f32_le(self.afx);
27502 __tmp.put_f32_le(self.afy);
27503 __tmp.put_f32_le(self.afz);
27504 __tmp.put_f32_le(self.yaw);
27505 __tmp.put_f32_le(self.yaw_rate);
27506 __tmp.put_u16_le(self.type_mask.bits());
27507 __tmp.put_u8(self.target_system);
27508 __tmp.put_u8(self.target_component);
27509 __tmp.put_u8(self.coordinate_frame as u8);
27510 if matches!(version, MavlinkVersion::V2) {
27511 let len = __tmp.len();
27512 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27513 } else {
27514 __tmp.len()
27515 }
27516 }
27517}
27518#[doc = "Status of simulation environment, if used."]
27519#[doc = ""]
27520#[doc = "ID: 108"]
27521#[derive(Debug, Clone, PartialEq)]
27522#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27523#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27524pub struct SIM_STATE_DATA {
27525 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
27526 pub q1: f32,
27527 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
27528 pub q2: f32,
27529 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
27530 pub q3: f32,
27531 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
27532 pub q4: f32,
27533 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
27534 pub roll: f32,
27535 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
27536 pub pitch: f32,
27537 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
27538 pub yaw: f32,
27539 #[doc = "X acceleration"]
27540 pub xacc: f32,
27541 #[doc = "Y acceleration"]
27542 pub yacc: f32,
27543 #[doc = "Z acceleration"]
27544 pub zacc: f32,
27545 #[doc = "Angular speed around X axis"]
27546 pub xgyro: f32,
27547 #[doc = "Angular speed around Y axis"]
27548 pub ygyro: f32,
27549 #[doc = "Angular speed around Z axis"]
27550 pub zgyro: f32,
27551 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
27552 pub lat: f32,
27553 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
27554 pub lon: f32,
27555 #[doc = "Altitude"]
27556 pub alt: f32,
27557 #[doc = "Horizontal position standard deviation"]
27558 pub std_dev_horz: f32,
27559 #[doc = "Vertical position standard deviation"]
27560 pub std_dev_vert: f32,
27561 #[doc = "True velocity in north direction in earth-fixed NED frame"]
27562 pub vn: f32,
27563 #[doc = "True velocity in east direction in earth-fixed NED frame"]
27564 pub ve: f32,
27565 #[doc = "True velocity in down direction in earth-fixed NED frame"]
27566 pub vd: f32,
27567 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
27568 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27569 pub lat_int: i32,
27570 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
27571 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27572 pub lon_int: i32,
27573}
27574impl SIM_STATE_DATA {
27575 pub const ENCODED_LEN: usize = 92usize;
27576 pub const DEFAULT: Self = Self {
27577 q1: 0.0_f32,
27578 q2: 0.0_f32,
27579 q3: 0.0_f32,
27580 q4: 0.0_f32,
27581 roll: 0.0_f32,
27582 pitch: 0.0_f32,
27583 yaw: 0.0_f32,
27584 xacc: 0.0_f32,
27585 yacc: 0.0_f32,
27586 zacc: 0.0_f32,
27587 xgyro: 0.0_f32,
27588 ygyro: 0.0_f32,
27589 zgyro: 0.0_f32,
27590 lat: 0.0_f32,
27591 lon: 0.0_f32,
27592 alt: 0.0_f32,
27593 std_dev_horz: 0.0_f32,
27594 std_dev_vert: 0.0_f32,
27595 vn: 0.0_f32,
27596 ve: 0.0_f32,
27597 vd: 0.0_f32,
27598 lat_int: 0_i32,
27599 lon_int: 0_i32,
27600 };
27601 #[cfg(feature = "arbitrary")]
27602 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27603 use arbitrary::{Arbitrary, Unstructured};
27604 let mut buf = [0u8; 1024];
27605 rng.fill_bytes(&mut buf);
27606 let mut unstructured = Unstructured::new(&buf);
27607 Self::arbitrary(&mut unstructured).unwrap_or_default()
27608 }
27609}
27610impl Default for SIM_STATE_DATA {
27611 fn default() -> Self {
27612 Self::DEFAULT.clone()
27613 }
27614}
27615impl MessageData for SIM_STATE_DATA {
27616 type Message = MavMessage;
27617 const ID: u32 = 108u32;
27618 const NAME: &'static str = "SIM_STATE";
27619 const EXTRA_CRC: u8 = 32u8;
27620 const ENCODED_LEN: usize = 92usize;
27621 fn deser(
27622 _version: MavlinkVersion,
27623 __input: &[u8],
27624 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27625 let avail_len = __input.len();
27626 let mut payload_buf = [0; Self::ENCODED_LEN];
27627 let mut buf = if avail_len < Self::ENCODED_LEN {
27628 payload_buf[0..avail_len].copy_from_slice(__input);
27629 Bytes::new(&payload_buf)
27630 } else {
27631 Bytes::new(__input)
27632 };
27633 let mut __struct = Self::default();
27634 __struct.q1 = buf.get_f32_le();
27635 __struct.q2 = buf.get_f32_le();
27636 __struct.q3 = buf.get_f32_le();
27637 __struct.q4 = buf.get_f32_le();
27638 __struct.roll = buf.get_f32_le();
27639 __struct.pitch = buf.get_f32_le();
27640 __struct.yaw = buf.get_f32_le();
27641 __struct.xacc = buf.get_f32_le();
27642 __struct.yacc = buf.get_f32_le();
27643 __struct.zacc = buf.get_f32_le();
27644 __struct.xgyro = buf.get_f32_le();
27645 __struct.ygyro = buf.get_f32_le();
27646 __struct.zgyro = buf.get_f32_le();
27647 __struct.lat = buf.get_f32_le();
27648 __struct.lon = buf.get_f32_le();
27649 __struct.alt = buf.get_f32_le();
27650 __struct.std_dev_horz = buf.get_f32_le();
27651 __struct.std_dev_vert = buf.get_f32_le();
27652 __struct.vn = buf.get_f32_le();
27653 __struct.ve = buf.get_f32_le();
27654 __struct.vd = buf.get_f32_le();
27655 __struct.lat_int = buf.get_i32_le();
27656 __struct.lon_int = buf.get_i32_le();
27657 Ok(__struct)
27658 }
27659 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27660 let mut __tmp = BytesMut::new(bytes);
27661 #[allow(clippy::absurd_extreme_comparisons)]
27662 #[allow(unused_comparisons)]
27663 if __tmp.remaining() < Self::ENCODED_LEN {
27664 panic!(
27665 "buffer is too small (need {} bytes, but got {})",
27666 Self::ENCODED_LEN,
27667 __tmp.remaining(),
27668 )
27669 }
27670 __tmp.put_f32_le(self.q1);
27671 __tmp.put_f32_le(self.q2);
27672 __tmp.put_f32_le(self.q3);
27673 __tmp.put_f32_le(self.q4);
27674 __tmp.put_f32_le(self.roll);
27675 __tmp.put_f32_le(self.pitch);
27676 __tmp.put_f32_le(self.yaw);
27677 __tmp.put_f32_le(self.xacc);
27678 __tmp.put_f32_le(self.yacc);
27679 __tmp.put_f32_le(self.zacc);
27680 __tmp.put_f32_le(self.xgyro);
27681 __tmp.put_f32_le(self.ygyro);
27682 __tmp.put_f32_le(self.zgyro);
27683 __tmp.put_f32_le(self.lat);
27684 __tmp.put_f32_le(self.lon);
27685 __tmp.put_f32_le(self.alt);
27686 __tmp.put_f32_le(self.std_dev_horz);
27687 __tmp.put_f32_le(self.std_dev_vert);
27688 __tmp.put_f32_le(self.vn);
27689 __tmp.put_f32_le(self.ve);
27690 __tmp.put_f32_le(self.vd);
27691 if matches!(version, MavlinkVersion::V2) {
27692 __tmp.put_i32_le(self.lat_int);
27693 __tmp.put_i32_le(self.lon_int);
27694 let len = __tmp.len();
27695 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27696 } else {
27697 __tmp.len()
27698 }
27699 }
27700}
27701#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
27702#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
27703#[doc = ""]
27704#[doc = "ID: 370"]
27705#[derive(Debug, Clone, PartialEq)]
27706#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27707#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27708pub struct SMART_BATTERY_INFO_DATA {
27709 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
27710 pub capacity_full_specification: i32,
27711 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
27712 pub capacity_full: i32,
27713 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
27714 pub cycle_count: u16,
27715 #[doc = "Battery weight. 0: field not provided."]
27716 pub weight: u16,
27717 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
27718 pub discharge_minimum_voltage: u16,
27719 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
27720 pub charging_minimum_voltage: u16,
27721 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
27722 pub resting_minimum_voltage: u16,
27723 #[doc = "Battery ID"]
27724 pub id: u8,
27725 #[doc = "Function of the battery"]
27726 pub battery_function: MavBatteryFunction,
27727 #[doc = "Type (chemistry) of the battery"]
27728 pub mavtype: MavBatteryType,
27729 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
27730 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27731 pub serial_number: [u8; 16],
27732 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
27733 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27734 pub device_name: [u8; 50],
27735 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
27736 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27737 pub charging_maximum_voltage: u16,
27738 #[doc = "Number of battery cells in series. 0: field not provided."]
27739 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27740 pub cells_in_series: u8,
27741 #[doc = "Maximum pack discharge current. 0: field not provided."]
27742 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27743 pub discharge_maximum_current: u32,
27744 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
27745 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27746 pub discharge_maximum_burst_current: u32,
27747 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
27748 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27749 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27750 pub manufacture_date: [u8; 11],
27751}
27752impl SMART_BATTERY_INFO_DATA {
27753 pub const ENCODED_LEN: usize = 109usize;
27754 pub const DEFAULT: Self = Self {
27755 capacity_full_specification: 0_i32,
27756 capacity_full: 0_i32,
27757 cycle_count: 0_u16,
27758 weight: 0_u16,
27759 discharge_minimum_voltage: 0_u16,
27760 charging_minimum_voltage: 0_u16,
27761 resting_minimum_voltage: 0_u16,
27762 id: 0_u8,
27763 battery_function: MavBatteryFunction::DEFAULT,
27764 mavtype: MavBatteryType::DEFAULT,
27765 serial_number: [0_u8; 16usize],
27766 device_name: [0_u8; 50usize],
27767 charging_maximum_voltage: 0_u16,
27768 cells_in_series: 0_u8,
27769 discharge_maximum_current: 0_u32,
27770 discharge_maximum_burst_current: 0_u32,
27771 manufacture_date: [0_u8; 11usize],
27772 };
27773 #[cfg(feature = "arbitrary")]
27774 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27775 use arbitrary::{Arbitrary, Unstructured};
27776 let mut buf = [0u8; 1024];
27777 rng.fill_bytes(&mut buf);
27778 let mut unstructured = Unstructured::new(&buf);
27779 Self::arbitrary(&mut unstructured).unwrap_or_default()
27780 }
27781}
27782impl Default for SMART_BATTERY_INFO_DATA {
27783 fn default() -> Self {
27784 Self::DEFAULT.clone()
27785 }
27786}
27787impl MessageData for SMART_BATTERY_INFO_DATA {
27788 type Message = MavMessage;
27789 const ID: u32 = 370u32;
27790 const NAME: &'static str = "SMART_BATTERY_INFO";
27791 const EXTRA_CRC: u8 = 75u8;
27792 const ENCODED_LEN: usize = 109usize;
27793 fn deser(
27794 _version: MavlinkVersion,
27795 __input: &[u8],
27796 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27797 let avail_len = __input.len();
27798 let mut payload_buf = [0; Self::ENCODED_LEN];
27799 let mut buf = if avail_len < Self::ENCODED_LEN {
27800 payload_buf[0..avail_len].copy_from_slice(__input);
27801 Bytes::new(&payload_buf)
27802 } else {
27803 Bytes::new(__input)
27804 };
27805 let mut __struct = Self::default();
27806 __struct.capacity_full_specification = buf.get_i32_le();
27807 __struct.capacity_full = buf.get_i32_le();
27808 __struct.cycle_count = buf.get_u16_le();
27809 __struct.weight = buf.get_u16_le();
27810 __struct.discharge_minimum_voltage = buf.get_u16_le();
27811 __struct.charging_minimum_voltage = buf.get_u16_le();
27812 __struct.resting_minimum_voltage = buf.get_u16_le();
27813 __struct.id = buf.get_u8();
27814 let tmp = buf.get_u8();
27815 __struct.battery_function =
27816 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27817 enum_type: "MavBatteryFunction",
27818 value: tmp as u32,
27819 })?;
27820 let tmp = buf.get_u8();
27821 __struct.mavtype =
27822 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27823 enum_type: "MavBatteryType",
27824 value: tmp as u32,
27825 })?;
27826 for v in &mut __struct.serial_number {
27827 let val = buf.get_u8();
27828 *v = val;
27829 }
27830 for v in &mut __struct.device_name {
27831 let val = buf.get_u8();
27832 *v = val;
27833 }
27834 __struct.charging_maximum_voltage = buf.get_u16_le();
27835 __struct.cells_in_series = buf.get_u8();
27836 __struct.discharge_maximum_current = buf.get_u32_le();
27837 __struct.discharge_maximum_burst_current = buf.get_u32_le();
27838 for v in &mut __struct.manufacture_date {
27839 let val = buf.get_u8();
27840 *v = val;
27841 }
27842 Ok(__struct)
27843 }
27844 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27845 let mut __tmp = BytesMut::new(bytes);
27846 #[allow(clippy::absurd_extreme_comparisons)]
27847 #[allow(unused_comparisons)]
27848 if __tmp.remaining() < Self::ENCODED_LEN {
27849 panic!(
27850 "buffer is too small (need {} bytes, but got {})",
27851 Self::ENCODED_LEN,
27852 __tmp.remaining(),
27853 )
27854 }
27855 __tmp.put_i32_le(self.capacity_full_specification);
27856 __tmp.put_i32_le(self.capacity_full);
27857 __tmp.put_u16_le(self.cycle_count);
27858 __tmp.put_u16_le(self.weight);
27859 __tmp.put_u16_le(self.discharge_minimum_voltage);
27860 __tmp.put_u16_le(self.charging_minimum_voltage);
27861 __tmp.put_u16_le(self.resting_minimum_voltage);
27862 __tmp.put_u8(self.id);
27863 __tmp.put_u8(self.battery_function as u8);
27864 __tmp.put_u8(self.mavtype as u8);
27865 for val in &self.serial_number {
27866 __tmp.put_u8(*val);
27867 }
27868 for val in &self.device_name {
27869 __tmp.put_u8(*val);
27870 }
27871 if matches!(version, MavlinkVersion::V2) {
27872 __tmp.put_u16_le(self.charging_maximum_voltage);
27873 __tmp.put_u8(self.cells_in_series);
27874 __tmp.put_u32_le(self.discharge_maximum_current);
27875 __tmp.put_u32_le(self.discharge_maximum_burst_current);
27876 for val in &self.manufacture_date {
27877 __tmp.put_u8(*val);
27878 }
27879 let len = __tmp.len();
27880 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27881 } else {
27882 __tmp.len()
27883 }
27884 }
27885}
27886#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
27887#[doc = ""]
27888#[doc = "ID: 253"]
27889#[derive(Debug, Clone, PartialEq)]
27890#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27891#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27892pub struct STATUSTEXT_DATA {
27893 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
27894 pub severity: MavSeverity,
27895 #[doc = "Status text message, without null termination character"]
27896 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27897 pub text: [u8; 50],
27898 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
27899 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27900 pub id: u16,
27901 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
27902 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27903 pub chunk_seq: u8,
27904}
27905impl STATUSTEXT_DATA {
27906 pub const ENCODED_LEN: usize = 54usize;
27907 pub const DEFAULT: Self = Self {
27908 severity: MavSeverity::DEFAULT,
27909 text: [0_u8; 50usize],
27910 id: 0_u16,
27911 chunk_seq: 0_u8,
27912 };
27913 #[cfg(feature = "arbitrary")]
27914 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27915 use arbitrary::{Arbitrary, Unstructured};
27916 let mut buf = [0u8; 1024];
27917 rng.fill_bytes(&mut buf);
27918 let mut unstructured = Unstructured::new(&buf);
27919 Self::arbitrary(&mut unstructured).unwrap_or_default()
27920 }
27921}
27922impl Default for STATUSTEXT_DATA {
27923 fn default() -> Self {
27924 Self::DEFAULT.clone()
27925 }
27926}
27927impl MessageData for STATUSTEXT_DATA {
27928 type Message = MavMessage;
27929 const ID: u32 = 253u32;
27930 const NAME: &'static str = "STATUSTEXT";
27931 const EXTRA_CRC: u8 = 83u8;
27932 const ENCODED_LEN: usize = 54usize;
27933 fn deser(
27934 _version: MavlinkVersion,
27935 __input: &[u8],
27936 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27937 let avail_len = __input.len();
27938 let mut payload_buf = [0; Self::ENCODED_LEN];
27939 let mut buf = if avail_len < Self::ENCODED_LEN {
27940 payload_buf[0..avail_len].copy_from_slice(__input);
27941 Bytes::new(&payload_buf)
27942 } else {
27943 Bytes::new(__input)
27944 };
27945 let mut __struct = Self::default();
27946 let tmp = buf.get_u8();
27947 __struct.severity =
27948 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27949 enum_type: "MavSeverity",
27950 value: tmp as u32,
27951 })?;
27952 for v in &mut __struct.text {
27953 let val = buf.get_u8();
27954 *v = val;
27955 }
27956 __struct.id = buf.get_u16_le();
27957 __struct.chunk_seq = buf.get_u8();
27958 Ok(__struct)
27959 }
27960 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27961 let mut __tmp = BytesMut::new(bytes);
27962 #[allow(clippy::absurd_extreme_comparisons)]
27963 #[allow(unused_comparisons)]
27964 if __tmp.remaining() < Self::ENCODED_LEN {
27965 panic!(
27966 "buffer is too small (need {} bytes, but got {})",
27967 Self::ENCODED_LEN,
27968 __tmp.remaining(),
27969 )
27970 }
27971 __tmp.put_u8(self.severity as u8);
27972 for val in &self.text {
27973 __tmp.put_u8(*val);
27974 }
27975 if matches!(version, MavlinkVersion::V2) {
27976 __tmp.put_u16_le(self.id);
27977 __tmp.put_u8(self.chunk_seq);
27978 let len = __tmp.len();
27979 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27980 } else {
27981 __tmp.len()
27982 }
27983 }
27984}
27985#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
27986#[doc = ""]
27987#[doc = "ID: 261"]
27988#[derive(Debug, Clone, PartialEq)]
27989#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27990#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27991pub struct STORAGE_INFORMATION_DATA {
27992 #[doc = "Timestamp (time since system boot)."]
27993 pub time_boot_ms: u32,
27994 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
27995 pub total_capacity: f32,
27996 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
27997 pub used_capacity: f32,
27998 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
27999 pub available_capacity: f32,
28000 #[doc = "Read speed."]
28001 pub read_speed: f32,
28002 #[doc = "Write speed."]
28003 pub write_speed: f32,
28004 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
28005 pub storage_id: u8,
28006 #[doc = "Number of storage devices"]
28007 pub storage_count: u8,
28008 #[doc = "Status of storage"]
28009 pub status: StorageStatus,
28010 #[doc = "Type of storage"]
28011 #[cfg_attr(feature = "serde", serde(default))]
28012 pub mavtype: StorageType,
28013 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
28014 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28015 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28016 pub name: [u8; 32],
28017 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
28018 #[cfg_attr(feature = "serde", serde(default))]
28019 pub storage_usage: StorageUsageFlag,
28020}
28021impl STORAGE_INFORMATION_DATA {
28022 pub const ENCODED_LEN: usize = 61usize;
28023 pub const DEFAULT: Self = Self {
28024 time_boot_ms: 0_u32,
28025 total_capacity: 0.0_f32,
28026 used_capacity: 0.0_f32,
28027 available_capacity: 0.0_f32,
28028 read_speed: 0.0_f32,
28029 write_speed: 0.0_f32,
28030 storage_id: 0_u8,
28031 storage_count: 0_u8,
28032 status: StorageStatus::DEFAULT,
28033 mavtype: StorageType::DEFAULT,
28034 name: [0_u8; 32usize],
28035 storage_usage: StorageUsageFlag::DEFAULT,
28036 };
28037 #[cfg(feature = "arbitrary")]
28038 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28039 use arbitrary::{Arbitrary, Unstructured};
28040 let mut buf = [0u8; 1024];
28041 rng.fill_bytes(&mut buf);
28042 let mut unstructured = Unstructured::new(&buf);
28043 Self::arbitrary(&mut unstructured).unwrap_or_default()
28044 }
28045}
28046impl Default for STORAGE_INFORMATION_DATA {
28047 fn default() -> Self {
28048 Self::DEFAULT.clone()
28049 }
28050}
28051impl MessageData for STORAGE_INFORMATION_DATA {
28052 type Message = MavMessage;
28053 const ID: u32 = 261u32;
28054 const NAME: &'static str = "STORAGE_INFORMATION";
28055 const EXTRA_CRC: u8 = 179u8;
28056 const ENCODED_LEN: usize = 61usize;
28057 fn deser(
28058 _version: MavlinkVersion,
28059 __input: &[u8],
28060 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28061 let avail_len = __input.len();
28062 let mut payload_buf = [0; Self::ENCODED_LEN];
28063 let mut buf = if avail_len < Self::ENCODED_LEN {
28064 payload_buf[0..avail_len].copy_from_slice(__input);
28065 Bytes::new(&payload_buf)
28066 } else {
28067 Bytes::new(__input)
28068 };
28069 let mut __struct = Self::default();
28070 __struct.time_boot_ms = buf.get_u32_le();
28071 __struct.total_capacity = buf.get_f32_le();
28072 __struct.used_capacity = buf.get_f32_le();
28073 __struct.available_capacity = buf.get_f32_le();
28074 __struct.read_speed = buf.get_f32_le();
28075 __struct.write_speed = buf.get_f32_le();
28076 __struct.storage_id = buf.get_u8();
28077 __struct.storage_count = buf.get_u8();
28078 let tmp = buf.get_u8();
28079 __struct.status =
28080 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28081 enum_type: "StorageStatus",
28082 value: tmp as u32,
28083 })?;
28084 let tmp = buf.get_u8();
28085 __struct.mavtype =
28086 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28087 enum_type: "StorageType",
28088 value: tmp as u32,
28089 })?;
28090 for v in &mut __struct.name {
28091 let val = buf.get_u8();
28092 *v = val;
28093 }
28094 let tmp = buf.get_u8();
28095 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
28096 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28097 flag_type: "StorageUsageFlag",
28098 value: tmp as u32,
28099 })?;
28100 Ok(__struct)
28101 }
28102 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28103 let mut __tmp = BytesMut::new(bytes);
28104 #[allow(clippy::absurd_extreme_comparisons)]
28105 #[allow(unused_comparisons)]
28106 if __tmp.remaining() < Self::ENCODED_LEN {
28107 panic!(
28108 "buffer is too small (need {} bytes, but got {})",
28109 Self::ENCODED_LEN,
28110 __tmp.remaining(),
28111 )
28112 }
28113 __tmp.put_u32_le(self.time_boot_ms);
28114 __tmp.put_f32_le(self.total_capacity);
28115 __tmp.put_f32_le(self.used_capacity);
28116 __tmp.put_f32_le(self.available_capacity);
28117 __tmp.put_f32_le(self.read_speed);
28118 __tmp.put_f32_le(self.write_speed);
28119 __tmp.put_u8(self.storage_id);
28120 __tmp.put_u8(self.storage_count);
28121 __tmp.put_u8(self.status as u8);
28122 if matches!(version, MavlinkVersion::V2) {
28123 __tmp.put_u8(self.mavtype as u8);
28124 for val in &self.name {
28125 __tmp.put_u8(*val);
28126 }
28127 __tmp.put_u8(self.storage_usage.bits());
28128 let len = __tmp.len();
28129 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28130 } else {
28131 __tmp.len()
28132 }
28133 }
28134}
28135#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
28136#[doc = ""]
28137#[doc = "ID: 401"]
28138#[derive(Debug, Clone, PartialEq)]
28139#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28140#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28141pub struct SUPPORTED_TUNES_DATA {
28142 #[doc = "Bitfield of supported tune formats."]
28143 pub format: TuneFormat,
28144 #[doc = "System ID"]
28145 pub target_system: u8,
28146 #[doc = "Component ID"]
28147 pub target_component: u8,
28148}
28149impl SUPPORTED_TUNES_DATA {
28150 pub const ENCODED_LEN: usize = 6usize;
28151 pub const DEFAULT: Self = Self {
28152 format: TuneFormat::DEFAULT,
28153 target_system: 0_u8,
28154 target_component: 0_u8,
28155 };
28156 #[cfg(feature = "arbitrary")]
28157 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28158 use arbitrary::{Arbitrary, Unstructured};
28159 let mut buf = [0u8; 1024];
28160 rng.fill_bytes(&mut buf);
28161 let mut unstructured = Unstructured::new(&buf);
28162 Self::arbitrary(&mut unstructured).unwrap_or_default()
28163 }
28164}
28165impl Default for SUPPORTED_TUNES_DATA {
28166 fn default() -> Self {
28167 Self::DEFAULT.clone()
28168 }
28169}
28170impl MessageData for SUPPORTED_TUNES_DATA {
28171 type Message = MavMessage;
28172 const ID: u32 = 401u32;
28173 const NAME: &'static str = "SUPPORTED_TUNES";
28174 const EXTRA_CRC: u8 = 183u8;
28175 const ENCODED_LEN: usize = 6usize;
28176 fn deser(
28177 _version: MavlinkVersion,
28178 __input: &[u8],
28179 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28180 let avail_len = __input.len();
28181 let mut payload_buf = [0; Self::ENCODED_LEN];
28182 let mut buf = if avail_len < Self::ENCODED_LEN {
28183 payload_buf[0..avail_len].copy_from_slice(__input);
28184 Bytes::new(&payload_buf)
28185 } else {
28186 Bytes::new(__input)
28187 };
28188 let mut __struct = Self::default();
28189 let tmp = buf.get_u32_le();
28190 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
28191 ::mavlink_core::error::ParserError::InvalidEnum {
28192 enum_type: "TuneFormat",
28193 value: tmp as u32,
28194 },
28195 )?;
28196 __struct.target_system = buf.get_u8();
28197 __struct.target_component = buf.get_u8();
28198 Ok(__struct)
28199 }
28200 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28201 let mut __tmp = BytesMut::new(bytes);
28202 #[allow(clippy::absurd_extreme_comparisons)]
28203 #[allow(unused_comparisons)]
28204 if __tmp.remaining() < Self::ENCODED_LEN {
28205 panic!(
28206 "buffer is too small (need {} bytes, but got {})",
28207 Self::ENCODED_LEN,
28208 __tmp.remaining(),
28209 )
28210 }
28211 __tmp.put_u32_le(self.format as u32);
28212 __tmp.put_u8(self.target_system);
28213 __tmp.put_u8(self.target_component);
28214 if matches!(version, MavlinkVersion::V2) {
28215 let len = __tmp.len();
28216 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28217 } else {
28218 __tmp.len()
28219 }
28220 }
28221}
28222#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
28223#[doc = ""]
28224#[doc = "ID: 2"]
28225#[derive(Debug, Clone, PartialEq)]
28226#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28227#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28228pub struct SYSTEM_TIME_DATA {
28229 #[doc = "Timestamp (UNIX epoch time)."]
28230 pub time_unix_usec: u64,
28231 #[doc = "Timestamp (time since system boot)."]
28232 pub time_boot_ms: u32,
28233}
28234impl SYSTEM_TIME_DATA {
28235 pub const ENCODED_LEN: usize = 12usize;
28236 pub const DEFAULT: Self = Self {
28237 time_unix_usec: 0_u64,
28238 time_boot_ms: 0_u32,
28239 };
28240 #[cfg(feature = "arbitrary")]
28241 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28242 use arbitrary::{Arbitrary, Unstructured};
28243 let mut buf = [0u8; 1024];
28244 rng.fill_bytes(&mut buf);
28245 let mut unstructured = Unstructured::new(&buf);
28246 Self::arbitrary(&mut unstructured).unwrap_or_default()
28247 }
28248}
28249impl Default for SYSTEM_TIME_DATA {
28250 fn default() -> Self {
28251 Self::DEFAULT.clone()
28252 }
28253}
28254impl MessageData for SYSTEM_TIME_DATA {
28255 type Message = MavMessage;
28256 const ID: u32 = 2u32;
28257 const NAME: &'static str = "SYSTEM_TIME";
28258 const EXTRA_CRC: u8 = 137u8;
28259 const ENCODED_LEN: usize = 12usize;
28260 fn deser(
28261 _version: MavlinkVersion,
28262 __input: &[u8],
28263 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28264 let avail_len = __input.len();
28265 let mut payload_buf = [0; Self::ENCODED_LEN];
28266 let mut buf = if avail_len < Self::ENCODED_LEN {
28267 payload_buf[0..avail_len].copy_from_slice(__input);
28268 Bytes::new(&payload_buf)
28269 } else {
28270 Bytes::new(__input)
28271 };
28272 let mut __struct = Self::default();
28273 __struct.time_unix_usec = buf.get_u64_le();
28274 __struct.time_boot_ms = buf.get_u32_le();
28275 Ok(__struct)
28276 }
28277 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28278 let mut __tmp = BytesMut::new(bytes);
28279 #[allow(clippy::absurd_extreme_comparisons)]
28280 #[allow(unused_comparisons)]
28281 if __tmp.remaining() < Self::ENCODED_LEN {
28282 panic!(
28283 "buffer is too small (need {} bytes, but got {})",
28284 Self::ENCODED_LEN,
28285 __tmp.remaining(),
28286 )
28287 }
28288 __tmp.put_u64_le(self.time_unix_usec);
28289 __tmp.put_u32_le(self.time_boot_ms);
28290 if matches!(version, MavlinkVersion::V2) {
28291 let len = __tmp.len();
28292 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28293 } else {
28294 __tmp.len()
28295 }
28296 }
28297}
28298#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
28299#[doc = ""]
28300#[doc = "ID: 1"]
28301#[derive(Debug, Clone, PartialEq)]
28302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28303#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28304pub struct SYS_STATUS_DATA {
28305 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28306 pub onboard_control_sensors_present: MavSysStatusSensor,
28307 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28308 pub onboard_control_sensors_enabled: MavSysStatusSensor,
28309 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28310 pub onboard_control_sensors_health: MavSysStatusSensor,
28311 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
28312 pub load: u16,
28313 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
28314 pub voltage_battery: u16,
28315 #[doc = "Battery current, -1: Current not sent by autopilot"]
28316 pub current_battery: i16,
28317 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28318 pub drop_rate_comm: u16,
28319 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28320 pub errors_comm: u16,
28321 #[doc = "Autopilot-specific errors"]
28322 pub errors_count1: u16,
28323 #[doc = "Autopilot-specific errors"]
28324 pub errors_count2: u16,
28325 #[doc = "Autopilot-specific errors"]
28326 pub errors_count3: u16,
28327 #[doc = "Autopilot-specific errors"]
28328 pub errors_count4: u16,
28329 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
28330 pub battery_remaining: i8,
28331 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28332 #[cfg_attr(feature = "serde", serde(default))]
28333 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
28334 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28335 #[cfg_attr(feature = "serde", serde(default))]
28336 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
28337 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28338 #[cfg_attr(feature = "serde", serde(default))]
28339 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
28340}
28341impl SYS_STATUS_DATA {
28342 pub const ENCODED_LEN: usize = 43usize;
28343 pub const DEFAULT: Self = Self {
28344 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
28345 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
28346 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
28347 load: 0_u16,
28348 voltage_battery: 0_u16,
28349 current_battery: 0_i16,
28350 drop_rate_comm: 0_u16,
28351 errors_comm: 0_u16,
28352 errors_count1: 0_u16,
28353 errors_count2: 0_u16,
28354 errors_count3: 0_u16,
28355 errors_count4: 0_u16,
28356 battery_remaining: 0_i8,
28357 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
28358 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
28359 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
28360 };
28361 #[cfg(feature = "arbitrary")]
28362 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28363 use arbitrary::{Arbitrary, Unstructured};
28364 let mut buf = [0u8; 1024];
28365 rng.fill_bytes(&mut buf);
28366 let mut unstructured = Unstructured::new(&buf);
28367 Self::arbitrary(&mut unstructured).unwrap_or_default()
28368 }
28369}
28370impl Default for SYS_STATUS_DATA {
28371 fn default() -> Self {
28372 Self::DEFAULT.clone()
28373 }
28374}
28375impl MessageData for SYS_STATUS_DATA {
28376 type Message = MavMessage;
28377 const ID: u32 = 1u32;
28378 const NAME: &'static str = "SYS_STATUS";
28379 const EXTRA_CRC: u8 = 124u8;
28380 const ENCODED_LEN: usize = 43usize;
28381 fn deser(
28382 _version: MavlinkVersion,
28383 __input: &[u8],
28384 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28385 let avail_len = __input.len();
28386 let mut payload_buf = [0; Self::ENCODED_LEN];
28387 let mut buf = if avail_len < Self::ENCODED_LEN {
28388 payload_buf[0..avail_len].copy_from_slice(__input);
28389 Bytes::new(&payload_buf)
28390 } else {
28391 Bytes::new(__input)
28392 };
28393 let mut __struct = Self::default();
28394 let tmp = buf.get_u32_le();
28395 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
28396 tmp & MavSysStatusSensor::all().bits(),
28397 )
28398 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28399 flag_type: "MavSysStatusSensor",
28400 value: tmp as u32,
28401 })?;
28402 let tmp = buf.get_u32_le();
28403 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
28404 tmp & MavSysStatusSensor::all().bits(),
28405 )
28406 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28407 flag_type: "MavSysStatusSensor",
28408 value: tmp as u32,
28409 })?;
28410 let tmp = buf.get_u32_le();
28411 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
28412 tmp & MavSysStatusSensor::all().bits(),
28413 )
28414 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28415 flag_type: "MavSysStatusSensor",
28416 value: tmp as u32,
28417 })?;
28418 __struct.load = buf.get_u16_le();
28419 __struct.voltage_battery = buf.get_u16_le();
28420 __struct.current_battery = buf.get_i16_le();
28421 __struct.drop_rate_comm = buf.get_u16_le();
28422 __struct.errors_comm = buf.get_u16_le();
28423 __struct.errors_count1 = buf.get_u16_le();
28424 __struct.errors_count2 = buf.get_u16_le();
28425 __struct.errors_count3 = buf.get_u16_le();
28426 __struct.errors_count4 = buf.get_u16_le();
28427 __struct.battery_remaining = buf.get_i8();
28428 let tmp = buf.get_u32_le();
28429 __struct.onboard_control_sensors_present_extended =
28430 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28431 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28432 flag_type: "MavSysStatusSensorExtended",
28433 value: tmp as u32,
28434 })?;
28435 let tmp = buf.get_u32_le();
28436 __struct.onboard_control_sensors_enabled_extended =
28437 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28438 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28439 flag_type: "MavSysStatusSensorExtended",
28440 value: tmp as u32,
28441 })?;
28442 let tmp = buf.get_u32_le();
28443 __struct.onboard_control_sensors_health_extended =
28444 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28445 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28446 flag_type: "MavSysStatusSensorExtended",
28447 value: tmp as u32,
28448 })?;
28449 Ok(__struct)
28450 }
28451 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28452 let mut __tmp = BytesMut::new(bytes);
28453 #[allow(clippy::absurd_extreme_comparisons)]
28454 #[allow(unused_comparisons)]
28455 if __tmp.remaining() < Self::ENCODED_LEN {
28456 panic!(
28457 "buffer is too small (need {} bytes, but got {})",
28458 Self::ENCODED_LEN,
28459 __tmp.remaining(),
28460 )
28461 }
28462 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
28463 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
28464 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
28465 __tmp.put_u16_le(self.load);
28466 __tmp.put_u16_le(self.voltage_battery);
28467 __tmp.put_i16_le(self.current_battery);
28468 __tmp.put_u16_le(self.drop_rate_comm);
28469 __tmp.put_u16_le(self.errors_comm);
28470 __tmp.put_u16_le(self.errors_count1);
28471 __tmp.put_u16_le(self.errors_count2);
28472 __tmp.put_u16_le(self.errors_count3);
28473 __tmp.put_u16_le(self.errors_count4);
28474 __tmp.put_i8(self.battery_remaining);
28475 if matches!(version, MavlinkVersion::V2) {
28476 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
28477 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
28478 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
28479 let len = __tmp.len();
28480 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28481 } else {
28482 __tmp.len()
28483 }
28484 }
28485}
28486#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
28487#[doc = ""]
28488#[doc = "ID: 135"]
28489#[derive(Debug, Clone, PartialEq)]
28490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28491#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28492pub struct TERRAIN_CHECK_DATA {
28493 #[doc = "Latitude"]
28494 pub lat: i32,
28495 #[doc = "Longitude"]
28496 pub lon: i32,
28497}
28498impl TERRAIN_CHECK_DATA {
28499 pub const ENCODED_LEN: usize = 8usize;
28500 pub const DEFAULT: Self = Self {
28501 lat: 0_i32,
28502 lon: 0_i32,
28503 };
28504 #[cfg(feature = "arbitrary")]
28505 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28506 use arbitrary::{Arbitrary, Unstructured};
28507 let mut buf = [0u8; 1024];
28508 rng.fill_bytes(&mut buf);
28509 let mut unstructured = Unstructured::new(&buf);
28510 Self::arbitrary(&mut unstructured).unwrap_or_default()
28511 }
28512}
28513impl Default for TERRAIN_CHECK_DATA {
28514 fn default() -> Self {
28515 Self::DEFAULT.clone()
28516 }
28517}
28518impl MessageData for TERRAIN_CHECK_DATA {
28519 type Message = MavMessage;
28520 const ID: u32 = 135u32;
28521 const NAME: &'static str = "TERRAIN_CHECK";
28522 const EXTRA_CRC: u8 = 203u8;
28523 const ENCODED_LEN: usize = 8usize;
28524 fn deser(
28525 _version: MavlinkVersion,
28526 __input: &[u8],
28527 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28528 let avail_len = __input.len();
28529 let mut payload_buf = [0; Self::ENCODED_LEN];
28530 let mut buf = if avail_len < Self::ENCODED_LEN {
28531 payload_buf[0..avail_len].copy_from_slice(__input);
28532 Bytes::new(&payload_buf)
28533 } else {
28534 Bytes::new(__input)
28535 };
28536 let mut __struct = Self::default();
28537 __struct.lat = buf.get_i32_le();
28538 __struct.lon = buf.get_i32_le();
28539 Ok(__struct)
28540 }
28541 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28542 let mut __tmp = BytesMut::new(bytes);
28543 #[allow(clippy::absurd_extreme_comparisons)]
28544 #[allow(unused_comparisons)]
28545 if __tmp.remaining() < Self::ENCODED_LEN {
28546 panic!(
28547 "buffer is too small (need {} bytes, but got {})",
28548 Self::ENCODED_LEN,
28549 __tmp.remaining(),
28550 )
28551 }
28552 __tmp.put_i32_le(self.lat);
28553 __tmp.put_i32_le(self.lon);
28554 if matches!(version, MavlinkVersion::V2) {
28555 let len = __tmp.len();
28556 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28557 } else {
28558 __tmp.len()
28559 }
28560 }
28561}
28562#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28563#[doc = ""]
28564#[doc = "ID: 134"]
28565#[derive(Debug, Clone, PartialEq)]
28566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28568pub struct TERRAIN_DATA_DATA {
28569 #[doc = "Latitude of SW corner of first grid"]
28570 pub lat: i32,
28571 #[doc = "Longitude of SW corner of first grid"]
28572 pub lon: i32,
28573 #[doc = "Grid spacing"]
28574 pub grid_spacing: u16,
28575 #[doc = "Terrain data MSL"]
28576 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28577 pub data: [i16; 16],
28578 #[doc = "bit within the terrain request mask"]
28579 pub gridbit: u8,
28580}
28581impl TERRAIN_DATA_DATA {
28582 pub const ENCODED_LEN: usize = 43usize;
28583 pub const DEFAULT: Self = Self {
28584 lat: 0_i32,
28585 lon: 0_i32,
28586 grid_spacing: 0_u16,
28587 data: [0_i16; 16usize],
28588 gridbit: 0_u8,
28589 };
28590 #[cfg(feature = "arbitrary")]
28591 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28592 use arbitrary::{Arbitrary, Unstructured};
28593 let mut buf = [0u8; 1024];
28594 rng.fill_bytes(&mut buf);
28595 let mut unstructured = Unstructured::new(&buf);
28596 Self::arbitrary(&mut unstructured).unwrap_or_default()
28597 }
28598}
28599impl Default for TERRAIN_DATA_DATA {
28600 fn default() -> Self {
28601 Self::DEFAULT.clone()
28602 }
28603}
28604impl MessageData for TERRAIN_DATA_DATA {
28605 type Message = MavMessage;
28606 const ID: u32 = 134u32;
28607 const NAME: &'static str = "TERRAIN_DATA";
28608 const EXTRA_CRC: u8 = 229u8;
28609 const ENCODED_LEN: usize = 43usize;
28610 fn deser(
28611 _version: MavlinkVersion,
28612 __input: &[u8],
28613 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28614 let avail_len = __input.len();
28615 let mut payload_buf = [0; Self::ENCODED_LEN];
28616 let mut buf = if avail_len < Self::ENCODED_LEN {
28617 payload_buf[0..avail_len].copy_from_slice(__input);
28618 Bytes::new(&payload_buf)
28619 } else {
28620 Bytes::new(__input)
28621 };
28622 let mut __struct = Self::default();
28623 __struct.lat = buf.get_i32_le();
28624 __struct.lon = buf.get_i32_le();
28625 __struct.grid_spacing = buf.get_u16_le();
28626 for v in &mut __struct.data {
28627 let val = buf.get_i16_le();
28628 *v = val;
28629 }
28630 __struct.gridbit = buf.get_u8();
28631 Ok(__struct)
28632 }
28633 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28634 let mut __tmp = BytesMut::new(bytes);
28635 #[allow(clippy::absurd_extreme_comparisons)]
28636 #[allow(unused_comparisons)]
28637 if __tmp.remaining() < Self::ENCODED_LEN {
28638 panic!(
28639 "buffer is too small (need {} bytes, but got {})",
28640 Self::ENCODED_LEN,
28641 __tmp.remaining(),
28642 )
28643 }
28644 __tmp.put_i32_le(self.lat);
28645 __tmp.put_i32_le(self.lon);
28646 __tmp.put_u16_le(self.grid_spacing);
28647 for val in &self.data {
28648 __tmp.put_i16_le(*val);
28649 }
28650 __tmp.put_u8(self.gridbit);
28651 if matches!(version, MavlinkVersion::V2) {
28652 let len = __tmp.len();
28653 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28654 } else {
28655 __tmp.len()
28656 }
28657 }
28658}
28659#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28660#[doc = ""]
28661#[doc = "ID: 136"]
28662#[derive(Debug, Clone, PartialEq)]
28663#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28664#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28665pub struct TERRAIN_REPORT_DATA {
28666 #[doc = "Latitude"]
28667 pub lat: i32,
28668 #[doc = "Longitude"]
28669 pub lon: i32,
28670 #[doc = "Terrain height MSL"]
28671 pub terrain_height: f32,
28672 #[doc = "Current vehicle height above lat/lon terrain height"]
28673 pub current_height: f32,
28674 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
28675 pub spacing: u16,
28676 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
28677 pub pending: u16,
28678 #[doc = "Number of 4x4 terrain blocks in memory"]
28679 pub loaded: u16,
28680}
28681impl TERRAIN_REPORT_DATA {
28682 pub const ENCODED_LEN: usize = 22usize;
28683 pub const DEFAULT: Self = Self {
28684 lat: 0_i32,
28685 lon: 0_i32,
28686 terrain_height: 0.0_f32,
28687 current_height: 0.0_f32,
28688 spacing: 0_u16,
28689 pending: 0_u16,
28690 loaded: 0_u16,
28691 };
28692 #[cfg(feature = "arbitrary")]
28693 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28694 use arbitrary::{Arbitrary, Unstructured};
28695 let mut buf = [0u8; 1024];
28696 rng.fill_bytes(&mut buf);
28697 let mut unstructured = Unstructured::new(&buf);
28698 Self::arbitrary(&mut unstructured).unwrap_or_default()
28699 }
28700}
28701impl Default for TERRAIN_REPORT_DATA {
28702 fn default() -> Self {
28703 Self::DEFAULT.clone()
28704 }
28705}
28706impl MessageData for TERRAIN_REPORT_DATA {
28707 type Message = MavMessage;
28708 const ID: u32 = 136u32;
28709 const NAME: &'static str = "TERRAIN_REPORT";
28710 const EXTRA_CRC: u8 = 1u8;
28711 const ENCODED_LEN: usize = 22usize;
28712 fn deser(
28713 _version: MavlinkVersion,
28714 __input: &[u8],
28715 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28716 let avail_len = __input.len();
28717 let mut payload_buf = [0; Self::ENCODED_LEN];
28718 let mut buf = if avail_len < Self::ENCODED_LEN {
28719 payload_buf[0..avail_len].copy_from_slice(__input);
28720 Bytes::new(&payload_buf)
28721 } else {
28722 Bytes::new(__input)
28723 };
28724 let mut __struct = Self::default();
28725 __struct.lat = buf.get_i32_le();
28726 __struct.lon = buf.get_i32_le();
28727 __struct.terrain_height = buf.get_f32_le();
28728 __struct.current_height = buf.get_f32_le();
28729 __struct.spacing = buf.get_u16_le();
28730 __struct.pending = buf.get_u16_le();
28731 __struct.loaded = buf.get_u16_le();
28732 Ok(__struct)
28733 }
28734 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28735 let mut __tmp = BytesMut::new(bytes);
28736 #[allow(clippy::absurd_extreme_comparisons)]
28737 #[allow(unused_comparisons)]
28738 if __tmp.remaining() < Self::ENCODED_LEN {
28739 panic!(
28740 "buffer is too small (need {} bytes, but got {})",
28741 Self::ENCODED_LEN,
28742 __tmp.remaining(),
28743 )
28744 }
28745 __tmp.put_i32_le(self.lat);
28746 __tmp.put_i32_le(self.lon);
28747 __tmp.put_f32_le(self.terrain_height);
28748 __tmp.put_f32_le(self.current_height);
28749 __tmp.put_u16_le(self.spacing);
28750 __tmp.put_u16_le(self.pending);
28751 __tmp.put_u16_le(self.loaded);
28752 if matches!(version, MavlinkVersion::V2) {
28753 let len = __tmp.len();
28754 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28755 } else {
28756 __tmp.len()
28757 }
28758 }
28759}
28760#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28761#[doc = ""]
28762#[doc = "ID: 133"]
28763#[derive(Debug, Clone, PartialEq)]
28764#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28765#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28766pub struct TERRAIN_REQUEST_DATA {
28767 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
28768 pub mask: u64,
28769 #[doc = "Latitude of SW corner of first grid"]
28770 pub lat: i32,
28771 #[doc = "Longitude of SW corner of first grid"]
28772 pub lon: i32,
28773 #[doc = "Grid spacing"]
28774 pub grid_spacing: u16,
28775}
28776impl TERRAIN_REQUEST_DATA {
28777 pub const ENCODED_LEN: usize = 18usize;
28778 pub const DEFAULT: Self = Self {
28779 mask: 0_u64,
28780 lat: 0_i32,
28781 lon: 0_i32,
28782 grid_spacing: 0_u16,
28783 };
28784 #[cfg(feature = "arbitrary")]
28785 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28786 use arbitrary::{Arbitrary, Unstructured};
28787 let mut buf = [0u8; 1024];
28788 rng.fill_bytes(&mut buf);
28789 let mut unstructured = Unstructured::new(&buf);
28790 Self::arbitrary(&mut unstructured).unwrap_or_default()
28791 }
28792}
28793impl Default for TERRAIN_REQUEST_DATA {
28794 fn default() -> Self {
28795 Self::DEFAULT.clone()
28796 }
28797}
28798impl MessageData for TERRAIN_REQUEST_DATA {
28799 type Message = MavMessage;
28800 const ID: u32 = 133u32;
28801 const NAME: &'static str = "TERRAIN_REQUEST";
28802 const EXTRA_CRC: u8 = 6u8;
28803 const ENCODED_LEN: usize = 18usize;
28804 fn deser(
28805 _version: MavlinkVersion,
28806 __input: &[u8],
28807 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28808 let avail_len = __input.len();
28809 let mut payload_buf = [0; Self::ENCODED_LEN];
28810 let mut buf = if avail_len < Self::ENCODED_LEN {
28811 payload_buf[0..avail_len].copy_from_slice(__input);
28812 Bytes::new(&payload_buf)
28813 } else {
28814 Bytes::new(__input)
28815 };
28816 let mut __struct = Self::default();
28817 __struct.mask = buf.get_u64_le();
28818 __struct.lat = buf.get_i32_le();
28819 __struct.lon = buf.get_i32_le();
28820 __struct.grid_spacing = buf.get_u16_le();
28821 Ok(__struct)
28822 }
28823 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28824 let mut __tmp = BytesMut::new(bytes);
28825 #[allow(clippy::absurd_extreme_comparisons)]
28826 #[allow(unused_comparisons)]
28827 if __tmp.remaining() < Self::ENCODED_LEN {
28828 panic!(
28829 "buffer is too small (need {} bytes, but got {})",
28830 Self::ENCODED_LEN,
28831 __tmp.remaining(),
28832 )
28833 }
28834 __tmp.put_u64_le(self.mask);
28835 __tmp.put_i32_le(self.lat);
28836 __tmp.put_i32_le(self.lon);
28837 __tmp.put_u16_le(self.grid_spacing);
28838 if matches!(version, MavlinkVersion::V2) {
28839 let len = __tmp.len();
28840 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28841 } else {
28842 __tmp.len()
28843 }
28844 }
28845}
28846#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
28847#[doc = ""]
28848#[doc = "ID: 111"]
28849#[derive(Debug, Clone, PartialEq)]
28850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28851#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28852pub struct TIMESYNC_DATA {
28853 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
28854 pub tc1: i64,
28855 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
28856 pub ts1: i64,
28857 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
28858 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28859 pub target_system: u8,
28860 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
28861 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28862 pub target_component: u8,
28863}
28864impl TIMESYNC_DATA {
28865 pub const ENCODED_LEN: usize = 18usize;
28866 pub const DEFAULT: Self = Self {
28867 tc1: 0_i64,
28868 ts1: 0_i64,
28869 target_system: 0_u8,
28870 target_component: 0_u8,
28871 };
28872 #[cfg(feature = "arbitrary")]
28873 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28874 use arbitrary::{Arbitrary, Unstructured};
28875 let mut buf = [0u8; 1024];
28876 rng.fill_bytes(&mut buf);
28877 let mut unstructured = Unstructured::new(&buf);
28878 Self::arbitrary(&mut unstructured).unwrap_or_default()
28879 }
28880}
28881impl Default for TIMESYNC_DATA {
28882 fn default() -> Self {
28883 Self::DEFAULT.clone()
28884 }
28885}
28886impl MessageData for TIMESYNC_DATA {
28887 type Message = MavMessage;
28888 const ID: u32 = 111u32;
28889 const NAME: &'static str = "TIMESYNC";
28890 const EXTRA_CRC: u8 = 34u8;
28891 const ENCODED_LEN: usize = 18usize;
28892 fn deser(
28893 _version: MavlinkVersion,
28894 __input: &[u8],
28895 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28896 let avail_len = __input.len();
28897 let mut payload_buf = [0; Self::ENCODED_LEN];
28898 let mut buf = if avail_len < Self::ENCODED_LEN {
28899 payload_buf[0..avail_len].copy_from_slice(__input);
28900 Bytes::new(&payload_buf)
28901 } else {
28902 Bytes::new(__input)
28903 };
28904 let mut __struct = Self::default();
28905 __struct.tc1 = buf.get_i64_le();
28906 __struct.ts1 = buf.get_i64_le();
28907 __struct.target_system = buf.get_u8();
28908 __struct.target_component = buf.get_u8();
28909 Ok(__struct)
28910 }
28911 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28912 let mut __tmp = BytesMut::new(bytes);
28913 #[allow(clippy::absurd_extreme_comparisons)]
28914 #[allow(unused_comparisons)]
28915 if __tmp.remaining() < Self::ENCODED_LEN {
28916 panic!(
28917 "buffer is too small (need {} bytes, but got {})",
28918 Self::ENCODED_LEN,
28919 __tmp.remaining(),
28920 )
28921 }
28922 __tmp.put_i64_le(self.tc1);
28923 __tmp.put_i64_le(self.ts1);
28924 if matches!(version, MavlinkVersion::V2) {
28925 __tmp.put_u8(self.target_system);
28926 __tmp.put_u8(self.target_component);
28927 let len = __tmp.len();
28928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28929 } else {
28930 __tmp.len()
28931 }
28932 }
28933}
28934#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
28935#[doc = ""]
28936#[doc = "ID: 380"]
28937#[derive(Debug, Clone, PartialEq)]
28938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28940pub struct TIME_ESTIMATE_TO_TARGET_DATA {
28941 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
28942 pub safe_return: i32,
28943 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
28944 pub land: i32,
28945 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
28946 pub mission_next_item: i32,
28947 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
28948 pub mission_end: i32,
28949 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
28950 pub commanded_action: i32,
28951}
28952impl TIME_ESTIMATE_TO_TARGET_DATA {
28953 pub const ENCODED_LEN: usize = 20usize;
28954 pub const DEFAULT: Self = Self {
28955 safe_return: 0_i32,
28956 land: 0_i32,
28957 mission_next_item: 0_i32,
28958 mission_end: 0_i32,
28959 commanded_action: 0_i32,
28960 };
28961 #[cfg(feature = "arbitrary")]
28962 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28963 use arbitrary::{Arbitrary, Unstructured};
28964 let mut buf = [0u8; 1024];
28965 rng.fill_bytes(&mut buf);
28966 let mut unstructured = Unstructured::new(&buf);
28967 Self::arbitrary(&mut unstructured).unwrap_or_default()
28968 }
28969}
28970impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
28971 fn default() -> Self {
28972 Self::DEFAULT.clone()
28973 }
28974}
28975impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
28976 type Message = MavMessage;
28977 const ID: u32 = 380u32;
28978 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
28979 const EXTRA_CRC: u8 = 232u8;
28980 const ENCODED_LEN: usize = 20usize;
28981 fn deser(
28982 _version: MavlinkVersion,
28983 __input: &[u8],
28984 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28985 let avail_len = __input.len();
28986 let mut payload_buf = [0; Self::ENCODED_LEN];
28987 let mut buf = if avail_len < Self::ENCODED_LEN {
28988 payload_buf[0..avail_len].copy_from_slice(__input);
28989 Bytes::new(&payload_buf)
28990 } else {
28991 Bytes::new(__input)
28992 };
28993 let mut __struct = Self::default();
28994 __struct.safe_return = buf.get_i32_le();
28995 __struct.land = buf.get_i32_le();
28996 __struct.mission_next_item = buf.get_i32_le();
28997 __struct.mission_end = buf.get_i32_le();
28998 __struct.commanded_action = buf.get_i32_le();
28999 Ok(__struct)
29000 }
29001 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29002 let mut __tmp = BytesMut::new(bytes);
29003 #[allow(clippy::absurd_extreme_comparisons)]
29004 #[allow(unused_comparisons)]
29005 if __tmp.remaining() < Self::ENCODED_LEN {
29006 panic!(
29007 "buffer is too small (need {} bytes, but got {})",
29008 Self::ENCODED_LEN,
29009 __tmp.remaining(),
29010 )
29011 }
29012 __tmp.put_i32_le(self.safe_return);
29013 __tmp.put_i32_le(self.land);
29014 __tmp.put_i32_le(self.mission_next_item);
29015 __tmp.put_i32_le(self.mission_end);
29016 __tmp.put_i32_le(self.commanded_action);
29017 if matches!(version, MavlinkVersion::V2) {
29018 let len = __tmp.len();
29019 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29020 } else {
29021 __tmp.len()
29022 }
29023 }
29024}
29025#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
29026#[doc = ""]
29027#[doc = "ID: 333"]
29028#[derive(Debug, Clone, PartialEq)]
29029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29031pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29032 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29033 pub time_usec: u64,
29034 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
29035 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29036 pub pos_x: [f32; 5],
29037 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
29038 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29039 pub pos_y: [f32; 5],
29040 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
29041 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29042 pub pos_z: [f32; 5],
29043 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
29044 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29045 pub delta: [f32; 5],
29046 #[doc = "Yaw. Set to NaN for unchanged"]
29047 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29048 pub pos_yaw: [f32; 5],
29049 #[doc = "Number of valid control points (up-to 5 points are possible)"]
29050 pub valid_points: u8,
29051}
29052impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29053 pub const ENCODED_LEN: usize = 109usize;
29054 pub const DEFAULT: Self = Self {
29055 time_usec: 0_u64,
29056 pos_x: [0.0_f32; 5usize],
29057 pos_y: [0.0_f32; 5usize],
29058 pos_z: [0.0_f32; 5usize],
29059 delta: [0.0_f32; 5usize],
29060 pos_yaw: [0.0_f32; 5usize],
29061 valid_points: 0_u8,
29062 };
29063 #[cfg(feature = "arbitrary")]
29064 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29065 use arbitrary::{Arbitrary, Unstructured};
29066 let mut buf = [0u8; 1024];
29067 rng.fill_bytes(&mut buf);
29068 let mut unstructured = Unstructured::new(&buf);
29069 Self::arbitrary(&mut unstructured).unwrap_or_default()
29070 }
29071}
29072impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29073 fn default() -> Self {
29074 Self::DEFAULT.clone()
29075 }
29076}
29077impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29078 type Message = MavMessage;
29079 const ID: u32 = 333u32;
29080 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
29081 const EXTRA_CRC: u8 = 231u8;
29082 const ENCODED_LEN: usize = 109usize;
29083 fn deser(
29084 _version: MavlinkVersion,
29085 __input: &[u8],
29086 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29087 let avail_len = __input.len();
29088 let mut payload_buf = [0; Self::ENCODED_LEN];
29089 let mut buf = if avail_len < Self::ENCODED_LEN {
29090 payload_buf[0..avail_len].copy_from_slice(__input);
29091 Bytes::new(&payload_buf)
29092 } else {
29093 Bytes::new(__input)
29094 };
29095 let mut __struct = Self::default();
29096 __struct.time_usec = buf.get_u64_le();
29097 for v in &mut __struct.pos_x {
29098 let val = buf.get_f32_le();
29099 *v = val;
29100 }
29101 for v in &mut __struct.pos_y {
29102 let val = buf.get_f32_le();
29103 *v = val;
29104 }
29105 for v in &mut __struct.pos_z {
29106 let val = buf.get_f32_le();
29107 *v = val;
29108 }
29109 for v in &mut __struct.delta {
29110 let val = buf.get_f32_le();
29111 *v = val;
29112 }
29113 for v in &mut __struct.pos_yaw {
29114 let val = buf.get_f32_le();
29115 *v = val;
29116 }
29117 __struct.valid_points = buf.get_u8();
29118 Ok(__struct)
29119 }
29120 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29121 let mut __tmp = BytesMut::new(bytes);
29122 #[allow(clippy::absurd_extreme_comparisons)]
29123 #[allow(unused_comparisons)]
29124 if __tmp.remaining() < Self::ENCODED_LEN {
29125 panic!(
29126 "buffer is too small (need {} bytes, but got {})",
29127 Self::ENCODED_LEN,
29128 __tmp.remaining(),
29129 )
29130 }
29131 __tmp.put_u64_le(self.time_usec);
29132 for val in &self.pos_x {
29133 __tmp.put_f32_le(*val);
29134 }
29135 for val in &self.pos_y {
29136 __tmp.put_f32_le(*val);
29137 }
29138 for val in &self.pos_z {
29139 __tmp.put_f32_le(*val);
29140 }
29141 for val in &self.delta {
29142 __tmp.put_f32_le(*val);
29143 }
29144 for val in &self.pos_yaw {
29145 __tmp.put_f32_le(*val);
29146 }
29147 __tmp.put_u8(self.valid_points);
29148 if matches!(version, MavlinkVersion::V2) {
29149 let len = __tmp.len();
29150 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29151 } else {
29152 __tmp.len()
29153 }
29154 }
29155}
29156#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
29157#[doc = ""]
29158#[doc = "ID: 332"]
29159#[derive(Debug, Clone, PartialEq)]
29160#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29161#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29162pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29163 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29164 pub time_usec: u64,
29165 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
29166 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29167 pub pos_x: [f32; 5],
29168 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
29169 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29170 pub pos_y: [f32; 5],
29171 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
29172 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29173 pub pos_z: [f32; 5],
29174 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
29175 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29176 pub vel_x: [f32; 5],
29177 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
29178 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29179 pub vel_y: [f32; 5],
29180 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
29181 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29182 pub vel_z: [f32; 5],
29183 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
29184 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29185 pub acc_x: [f32; 5],
29186 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
29187 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29188 pub acc_y: [f32; 5],
29189 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
29190 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29191 pub acc_z: [f32; 5],
29192 #[doc = "Yaw angle, set to NaN if not being used"]
29193 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29194 pub pos_yaw: [f32; 5],
29195 #[doc = "Yaw rate, set to NaN if not being used"]
29196 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29197 pub vel_yaw: [f32; 5],
29198 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
29199 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29200 pub command: [u16; 5],
29201 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
29202 pub valid_points: u8,
29203}
29204impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29205 pub const ENCODED_LEN: usize = 239usize;
29206 pub const DEFAULT: Self = Self {
29207 time_usec: 0_u64,
29208 pos_x: [0.0_f32; 5usize],
29209 pos_y: [0.0_f32; 5usize],
29210 pos_z: [0.0_f32; 5usize],
29211 vel_x: [0.0_f32; 5usize],
29212 vel_y: [0.0_f32; 5usize],
29213 vel_z: [0.0_f32; 5usize],
29214 acc_x: [0.0_f32; 5usize],
29215 acc_y: [0.0_f32; 5usize],
29216 acc_z: [0.0_f32; 5usize],
29217 pos_yaw: [0.0_f32; 5usize],
29218 vel_yaw: [0.0_f32; 5usize],
29219 command: [0_u16; 5usize],
29220 valid_points: 0_u8,
29221 };
29222 #[cfg(feature = "arbitrary")]
29223 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29224 use arbitrary::{Arbitrary, Unstructured};
29225 let mut buf = [0u8; 1024];
29226 rng.fill_bytes(&mut buf);
29227 let mut unstructured = Unstructured::new(&buf);
29228 Self::arbitrary(&mut unstructured).unwrap_or_default()
29229 }
29230}
29231impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29232 fn default() -> Self {
29233 Self::DEFAULT.clone()
29234 }
29235}
29236impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29237 type Message = MavMessage;
29238 const ID: u32 = 332u32;
29239 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
29240 const EXTRA_CRC: u8 = 236u8;
29241 const ENCODED_LEN: usize = 239usize;
29242 fn deser(
29243 _version: MavlinkVersion,
29244 __input: &[u8],
29245 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29246 let avail_len = __input.len();
29247 let mut payload_buf = [0; Self::ENCODED_LEN];
29248 let mut buf = if avail_len < Self::ENCODED_LEN {
29249 payload_buf[0..avail_len].copy_from_slice(__input);
29250 Bytes::new(&payload_buf)
29251 } else {
29252 Bytes::new(__input)
29253 };
29254 let mut __struct = Self::default();
29255 __struct.time_usec = buf.get_u64_le();
29256 for v in &mut __struct.pos_x {
29257 let val = buf.get_f32_le();
29258 *v = val;
29259 }
29260 for v in &mut __struct.pos_y {
29261 let val = buf.get_f32_le();
29262 *v = val;
29263 }
29264 for v in &mut __struct.pos_z {
29265 let val = buf.get_f32_le();
29266 *v = val;
29267 }
29268 for v in &mut __struct.vel_x {
29269 let val = buf.get_f32_le();
29270 *v = val;
29271 }
29272 for v in &mut __struct.vel_y {
29273 let val = buf.get_f32_le();
29274 *v = val;
29275 }
29276 for v in &mut __struct.vel_z {
29277 let val = buf.get_f32_le();
29278 *v = val;
29279 }
29280 for v in &mut __struct.acc_x {
29281 let val = buf.get_f32_le();
29282 *v = val;
29283 }
29284 for v in &mut __struct.acc_y {
29285 let val = buf.get_f32_le();
29286 *v = val;
29287 }
29288 for v in &mut __struct.acc_z {
29289 let val = buf.get_f32_le();
29290 *v = val;
29291 }
29292 for v in &mut __struct.pos_yaw {
29293 let val = buf.get_f32_le();
29294 *v = val;
29295 }
29296 for v in &mut __struct.vel_yaw {
29297 let val = buf.get_f32_le();
29298 *v = val;
29299 }
29300 for v in &mut __struct.command {
29301 let val = buf.get_u16_le();
29302 *v = val;
29303 }
29304 __struct.valid_points = buf.get_u8();
29305 Ok(__struct)
29306 }
29307 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29308 let mut __tmp = BytesMut::new(bytes);
29309 #[allow(clippy::absurd_extreme_comparisons)]
29310 #[allow(unused_comparisons)]
29311 if __tmp.remaining() < Self::ENCODED_LEN {
29312 panic!(
29313 "buffer is too small (need {} bytes, but got {})",
29314 Self::ENCODED_LEN,
29315 __tmp.remaining(),
29316 )
29317 }
29318 __tmp.put_u64_le(self.time_usec);
29319 for val in &self.pos_x {
29320 __tmp.put_f32_le(*val);
29321 }
29322 for val in &self.pos_y {
29323 __tmp.put_f32_le(*val);
29324 }
29325 for val in &self.pos_z {
29326 __tmp.put_f32_le(*val);
29327 }
29328 for val in &self.vel_x {
29329 __tmp.put_f32_le(*val);
29330 }
29331 for val in &self.vel_y {
29332 __tmp.put_f32_le(*val);
29333 }
29334 for val in &self.vel_z {
29335 __tmp.put_f32_le(*val);
29336 }
29337 for val in &self.acc_x {
29338 __tmp.put_f32_le(*val);
29339 }
29340 for val in &self.acc_y {
29341 __tmp.put_f32_le(*val);
29342 }
29343 for val in &self.acc_z {
29344 __tmp.put_f32_le(*val);
29345 }
29346 for val in &self.pos_yaw {
29347 __tmp.put_f32_le(*val);
29348 }
29349 for val in &self.vel_yaw {
29350 __tmp.put_f32_le(*val);
29351 }
29352 for val in &self.command {
29353 __tmp.put_u16_le(*val);
29354 }
29355 __tmp.put_u8(self.valid_points);
29356 if matches!(version, MavlinkVersion::V2) {
29357 let len = __tmp.len();
29358 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29359 } else {
29360 __tmp.len()
29361 }
29362 }
29363}
29364#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
29365#[doc = ""]
29366#[doc = "ID: 385"]
29367#[derive(Debug, Clone, PartialEq)]
29368#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29369#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29370pub struct TUNNEL_DATA {
29371 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
29372 pub payload_type: MavTunnelPayloadType,
29373 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
29374 pub target_system: u8,
29375 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
29376 pub target_component: u8,
29377 #[doc = "Length of the data transported in payload"]
29378 pub payload_length: u8,
29379 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
29380 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29381 pub payload: [u8; 128],
29382}
29383impl TUNNEL_DATA {
29384 pub const ENCODED_LEN: usize = 133usize;
29385 pub const DEFAULT: Self = Self {
29386 payload_type: MavTunnelPayloadType::DEFAULT,
29387 target_system: 0_u8,
29388 target_component: 0_u8,
29389 payload_length: 0_u8,
29390 payload: [0_u8; 128usize],
29391 };
29392 #[cfg(feature = "arbitrary")]
29393 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29394 use arbitrary::{Arbitrary, Unstructured};
29395 let mut buf = [0u8; 1024];
29396 rng.fill_bytes(&mut buf);
29397 let mut unstructured = Unstructured::new(&buf);
29398 Self::arbitrary(&mut unstructured).unwrap_or_default()
29399 }
29400}
29401impl Default for TUNNEL_DATA {
29402 fn default() -> Self {
29403 Self::DEFAULT.clone()
29404 }
29405}
29406impl MessageData for TUNNEL_DATA {
29407 type Message = MavMessage;
29408 const ID: u32 = 385u32;
29409 const NAME: &'static str = "TUNNEL";
29410 const EXTRA_CRC: u8 = 147u8;
29411 const ENCODED_LEN: usize = 133usize;
29412 fn deser(
29413 _version: MavlinkVersion,
29414 __input: &[u8],
29415 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29416 let avail_len = __input.len();
29417 let mut payload_buf = [0; Self::ENCODED_LEN];
29418 let mut buf = if avail_len < Self::ENCODED_LEN {
29419 payload_buf[0..avail_len].copy_from_slice(__input);
29420 Bytes::new(&payload_buf)
29421 } else {
29422 Bytes::new(__input)
29423 };
29424 let mut __struct = Self::default();
29425 let tmp = buf.get_u16_le();
29426 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
29427 ::mavlink_core::error::ParserError::InvalidEnum {
29428 enum_type: "MavTunnelPayloadType",
29429 value: tmp as u32,
29430 },
29431 )?;
29432 __struct.target_system = buf.get_u8();
29433 __struct.target_component = buf.get_u8();
29434 __struct.payload_length = buf.get_u8();
29435 for v in &mut __struct.payload {
29436 let val = buf.get_u8();
29437 *v = val;
29438 }
29439 Ok(__struct)
29440 }
29441 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29442 let mut __tmp = BytesMut::new(bytes);
29443 #[allow(clippy::absurd_extreme_comparisons)]
29444 #[allow(unused_comparisons)]
29445 if __tmp.remaining() < Self::ENCODED_LEN {
29446 panic!(
29447 "buffer is too small (need {} bytes, but got {})",
29448 Self::ENCODED_LEN,
29449 __tmp.remaining(),
29450 )
29451 }
29452 __tmp.put_u16_le(self.payload_type as u16);
29453 __tmp.put_u8(self.target_system);
29454 __tmp.put_u8(self.target_component);
29455 __tmp.put_u8(self.payload_length);
29456 for val in &self.payload {
29457 __tmp.put_u8(*val);
29458 }
29459 if matches!(version, MavlinkVersion::V2) {
29460 let len = __tmp.len();
29461 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29462 } else {
29463 __tmp.len()
29464 }
29465 }
29466}
29467#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
29468#[doc = ""]
29469#[doc = "ID: 311"]
29470#[derive(Debug, Clone, PartialEq)]
29471#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29472#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29473pub struct UAVCAN_NODE_INFO_DATA {
29474 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29475 pub time_usec: u64,
29476 #[doc = "Time since the start-up of the node."]
29477 pub uptime_sec: u32,
29478 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
29479 pub sw_vcs_commit: u32,
29480 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
29481 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29482 pub name: [u8; 80],
29483 #[doc = "Hardware major version number."]
29484 pub hw_version_major: u8,
29485 #[doc = "Hardware minor version number."]
29486 pub hw_version_minor: u8,
29487 #[doc = "Hardware unique 128-bit ID."]
29488 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29489 pub hw_unique_id: [u8; 16],
29490 #[doc = "Software major version number."]
29491 pub sw_version_major: u8,
29492 #[doc = "Software minor version number."]
29493 pub sw_version_minor: u8,
29494}
29495impl UAVCAN_NODE_INFO_DATA {
29496 pub const ENCODED_LEN: usize = 116usize;
29497 pub const DEFAULT: Self = Self {
29498 time_usec: 0_u64,
29499 uptime_sec: 0_u32,
29500 sw_vcs_commit: 0_u32,
29501 name: [0_u8; 80usize],
29502 hw_version_major: 0_u8,
29503 hw_version_minor: 0_u8,
29504 hw_unique_id: [0_u8; 16usize],
29505 sw_version_major: 0_u8,
29506 sw_version_minor: 0_u8,
29507 };
29508 #[cfg(feature = "arbitrary")]
29509 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29510 use arbitrary::{Arbitrary, Unstructured};
29511 let mut buf = [0u8; 1024];
29512 rng.fill_bytes(&mut buf);
29513 let mut unstructured = Unstructured::new(&buf);
29514 Self::arbitrary(&mut unstructured).unwrap_or_default()
29515 }
29516}
29517impl Default for UAVCAN_NODE_INFO_DATA {
29518 fn default() -> Self {
29519 Self::DEFAULT.clone()
29520 }
29521}
29522impl MessageData for UAVCAN_NODE_INFO_DATA {
29523 type Message = MavMessage;
29524 const ID: u32 = 311u32;
29525 const NAME: &'static str = "UAVCAN_NODE_INFO";
29526 const EXTRA_CRC: u8 = 95u8;
29527 const ENCODED_LEN: usize = 116usize;
29528 fn deser(
29529 _version: MavlinkVersion,
29530 __input: &[u8],
29531 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29532 let avail_len = __input.len();
29533 let mut payload_buf = [0; Self::ENCODED_LEN];
29534 let mut buf = if avail_len < Self::ENCODED_LEN {
29535 payload_buf[0..avail_len].copy_from_slice(__input);
29536 Bytes::new(&payload_buf)
29537 } else {
29538 Bytes::new(__input)
29539 };
29540 let mut __struct = Self::default();
29541 __struct.time_usec = buf.get_u64_le();
29542 __struct.uptime_sec = buf.get_u32_le();
29543 __struct.sw_vcs_commit = buf.get_u32_le();
29544 for v in &mut __struct.name {
29545 let val = buf.get_u8();
29546 *v = val;
29547 }
29548 __struct.hw_version_major = buf.get_u8();
29549 __struct.hw_version_minor = buf.get_u8();
29550 for v in &mut __struct.hw_unique_id {
29551 let val = buf.get_u8();
29552 *v = val;
29553 }
29554 __struct.sw_version_major = buf.get_u8();
29555 __struct.sw_version_minor = buf.get_u8();
29556 Ok(__struct)
29557 }
29558 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29559 let mut __tmp = BytesMut::new(bytes);
29560 #[allow(clippy::absurd_extreme_comparisons)]
29561 #[allow(unused_comparisons)]
29562 if __tmp.remaining() < Self::ENCODED_LEN {
29563 panic!(
29564 "buffer is too small (need {} bytes, but got {})",
29565 Self::ENCODED_LEN,
29566 __tmp.remaining(),
29567 )
29568 }
29569 __tmp.put_u64_le(self.time_usec);
29570 __tmp.put_u32_le(self.uptime_sec);
29571 __tmp.put_u32_le(self.sw_vcs_commit);
29572 for val in &self.name {
29573 __tmp.put_u8(*val);
29574 }
29575 __tmp.put_u8(self.hw_version_major);
29576 __tmp.put_u8(self.hw_version_minor);
29577 for val in &self.hw_unique_id {
29578 __tmp.put_u8(*val);
29579 }
29580 __tmp.put_u8(self.sw_version_major);
29581 __tmp.put_u8(self.sw_version_minor);
29582 if matches!(version, MavlinkVersion::V2) {
29583 let len = __tmp.len();
29584 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29585 } else {
29586 __tmp.len()
29587 }
29588 }
29589}
29590#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
29591#[doc = ""]
29592#[doc = "ID: 310"]
29593#[derive(Debug, Clone, PartialEq)]
29594#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29595#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29596pub struct UAVCAN_NODE_STATUS_DATA {
29597 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29598 pub time_usec: u64,
29599 #[doc = "Time since the start-up of the node."]
29600 pub uptime_sec: u32,
29601 #[doc = "Vendor-specific status information."]
29602 pub vendor_specific_status_code: u16,
29603 #[doc = "Generalized node health status."]
29604 pub health: UavcanNodeHealth,
29605 #[doc = "Generalized operating mode."]
29606 pub mode: UavcanNodeMode,
29607 #[doc = "Not used currently."]
29608 pub sub_mode: u8,
29609}
29610impl UAVCAN_NODE_STATUS_DATA {
29611 pub const ENCODED_LEN: usize = 17usize;
29612 pub const DEFAULT: Self = Self {
29613 time_usec: 0_u64,
29614 uptime_sec: 0_u32,
29615 vendor_specific_status_code: 0_u16,
29616 health: UavcanNodeHealth::DEFAULT,
29617 mode: UavcanNodeMode::DEFAULT,
29618 sub_mode: 0_u8,
29619 };
29620 #[cfg(feature = "arbitrary")]
29621 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29622 use arbitrary::{Arbitrary, Unstructured};
29623 let mut buf = [0u8; 1024];
29624 rng.fill_bytes(&mut buf);
29625 let mut unstructured = Unstructured::new(&buf);
29626 Self::arbitrary(&mut unstructured).unwrap_or_default()
29627 }
29628}
29629impl Default for UAVCAN_NODE_STATUS_DATA {
29630 fn default() -> Self {
29631 Self::DEFAULT.clone()
29632 }
29633}
29634impl MessageData for UAVCAN_NODE_STATUS_DATA {
29635 type Message = MavMessage;
29636 const ID: u32 = 310u32;
29637 const NAME: &'static str = "UAVCAN_NODE_STATUS";
29638 const EXTRA_CRC: u8 = 28u8;
29639 const ENCODED_LEN: usize = 17usize;
29640 fn deser(
29641 _version: MavlinkVersion,
29642 __input: &[u8],
29643 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29644 let avail_len = __input.len();
29645 let mut payload_buf = [0; Self::ENCODED_LEN];
29646 let mut buf = if avail_len < Self::ENCODED_LEN {
29647 payload_buf[0..avail_len].copy_from_slice(__input);
29648 Bytes::new(&payload_buf)
29649 } else {
29650 Bytes::new(__input)
29651 };
29652 let mut __struct = Self::default();
29653 __struct.time_usec = buf.get_u64_le();
29654 __struct.uptime_sec = buf.get_u32_le();
29655 __struct.vendor_specific_status_code = buf.get_u16_le();
29656 let tmp = buf.get_u8();
29657 __struct.health =
29658 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29659 enum_type: "UavcanNodeHealth",
29660 value: tmp as u32,
29661 })?;
29662 let tmp = buf.get_u8();
29663 __struct.mode =
29664 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29665 enum_type: "UavcanNodeMode",
29666 value: tmp as u32,
29667 })?;
29668 __struct.sub_mode = buf.get_u8();
29669 Ok(__struct)
29670 }
29671 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29672 let mut __tmp = BytesMut::new(bytes);
29673 #[allow(clippy::absurd_extreme_comparisons)]
29674 #[allow(unused_comparisons)]
29675 if __tmp.remaining() < Self::ENCODED_LEN {
29676 panic!(
29677 "buffer is too small (need {} bytes, but got {})",
29678 Self::ENCODED_LEN,
29679 __tmp.remaining(),
29680 )
29681 }
29682 __tmp.put_u64_le(self.time_usec);
29683 __tmp.put_u32_le(self.uptime_sec);
29684 __tmp.put_u16_le(self.vendor_specific_status_code);
29685 __tmp.put_u8(self.health as u8);
29686 __tmp.put_u8(self.mode as u8);
29687 __tmp.put_u8(self.sub_mode);
29688 if matches!(version, MavlinkVersion::V2) {
29689 let len = __tmp.len();
29690 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29691 } else {
29692 __tmp.len()
29693 }
29694 }
29695}
29696#[doc = "The global position resulting from GPS and sensor fusion."]
29697#[doc = ""]
29698#[doc = "ID: 340"]
29699#[derive(Debug, Clone, PartialEq)]
29700#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29701#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29702pub struct UTM_GLOBAL_POSITION_DATA {
29703 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
29704 pub time: u64,
29705 #[doc = "Latitude (WGS84)"]
29706 pub lat: i32,
29707 #[doc = "Longitude (WGS84)"]
29708 pub lon: i32,
29709 #[doc = "Altitude (WGS84)"]
29710 pub alt: i32,
29711 #[doc = "Altitude above ground"]
29712 pub relative_alt: i32,
29713 #[doc = "Next waypoint, latitude (WGS84)"]
29714 pub next_lat: i32,
29715 #[doc = "Next waypoint, longitude (WGS84)"]
29716 pub next_lon: i32,
29717 #[doc = "Next waypoint, altitude (WGS84)"]
29718 pub next_alt: i32,
29719 #[doc = "Ground X speed (latitude, positive north)"]
29720 pub vx: i16,
29721 #[doc = "Ground Y speed (longitude, positive east)"]
29722 pub vy: i16,
29723 #[doc = "Ground Z speed (altitude, positive down)"]
29724 pub vz: i16,
29725 #[doc = "Horizontal position uncertainty (standard deviation)"]
29726 pub h_acc: u16,
29727 #[doc = "Altitude uncertainty (standard deviation)"]
29728 pub v_acc: u16,
29729 #[doc = "Speed uncertainty (standard deviation)"]
29730 pub vel_acc: u16,
29731 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
29732 pub update_rate: u16,
29733 #[doc = "Unique UAS ID."]
29734 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29735 pub uas_id: [u8; 18],
29736 #[doc = "Flight state"]
29737 pub flight_state: UtmFlightState,
29738 #[doc = "Bitwise OR combination of the data available flags."]
29739 pub flags: UtmDataAvailFlags,
29740}
29741impl UTM_GLOBAL_POSITION_DATA {
29742 pub const ENCODED_LEN: usize = 70usize;
29743 pub const DEFAULT: Self = Self {
29744 time: 0_u64,
29745 lat: 0_i32,
29746 lon: 0_i32,
29747 alt: 0_i32,
29748 relative_alt: 0_i32,
29749 next_lat: 0_i32,
29750 next_lon: 0_i32,
29751 next_alt: 0_i32,
29752 vx: 0_i16,
29753 vy: 0_i16,
29754 vz: 0_i16,
29755 h_acc: 0_u16,
29756 v_acc: 0_u16,
29757 vel_acc: 0_u16,
29758 update_rate: 0_u16,
29759 uas_id: [0_u8; 18usize],
29760 flight_state: UtmFlightState::DEFAULT,
29761 flags: UtmDataAvailFlags::DEFAULT,
29762 };
29763 #[cfg(feature = "arbitrary")]
29764 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29765 use arbitrary::{Arbitrary, Unstructured};
29766 let mut buf = [0u8; 1024];
29767 rng.fill_bytes(&mut buf);
29768 let mut unstructured = Unstructured::new(&buf);
29769 Self::arbitrary(&mut unstructured).unwrap_or_default()
29770 }
29771}
29772impl Default for UTM_GLOBAL_POSITION_DATA {
29773 fn default() -> Self {
29774 Self::DEFAULT.clone()
29775 }
29776}
29777impl MessageData for UTM_GLOBAL_POSITION_DATA {
29778 type Message = MavMessage;
29779 const ID: u32 = 340u32;
29780 const NAME: &'static str = "UTM_GLOBAL_POSITION";
29781 const EXTRA_CRC: u8 = 99u8;
29782 const ENCODED_LEN: usize = 70usize;
29783 fn deser(
29784 _version: MavlinkVersion,
29785 __input: &[u8],
29786 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29787 let avail_len = __input.len();
29788 let mut payload_buf = [0; Self::ENCODED_LEN];
29789 let mut buf = if avail_len < Self::ENCODED_LEN {
29790 payload_buf[0..avail_len].copy_from_slice(__input);
29791 Bytes::new(&payload_buf)
29792 } else {
29793 Bytes::new(__input)
29794 };
29795 let mut __struct = Self::default();
29796 __struct.time = buf.get_u64_le();
29797 __struct.lat = buf.get_i32_le();
29798 __struct.lon = buf.get_i32_le();
29799 __struct.alt = buf.get_i32_le();
29800 __struct.relative_alt = buf.get_i32_le();
29801 __struct.next_lat = buf.get_i32_le();
29802 __struct.next_lon = buf.get_i32_le();
29803 __struct.next_alt = buf.get_i32_le();
29804 __struct.vx = buf.get_i16_le();
29805 __struct.vy = buf.get_i16_le();
29806 __struct.vz = buf.get_i16_le();
29807 __struct.h_acc = buf.get_u16_le();
29808 __struct.v_acc = buf.get_u16_le();
29809 __struct.vel_acc = buf.get_u16_le();
29810 __struct.update_rate = buf.get_u16_le();
29811 for v in &mut __struct.uas_id {
29812 let val = buf.get_u8();
29813 *v = val;
29814 }
29815 let tmp = buf.get_u8();
29816 __struct.flight_state =
29817 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29818 enum_type: "UtmFlightState",
29819 value: tmp as u32,
29820 })?;
29821 let tmp = buf.get_u8();
29822 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
29823 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29824 flag_type: "UtmDataAvailFlags",
29825 value: tmp as u32,
29826 })?;
29827 Ok(__struct)
29828 }
29829 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29830 let mut __tmp = BytesMut::new(bytes);
29831 #[allow(clippy::absurd_extreme_comparisons)]
29832 #[allow(unused_comparisons)]
29833 if __tmp.remaining() < Self::ENCODED_LEN {
29834 panic!(
29835 "buffer is too small (need {} bytes, but got {})",
29836 Self::ENCODED_LEN,
29837 __tmp.remaining(),
29838 )
29839 }
29840 __tmp.put_u64_le(self.time);
29841 __tmp.put_i32_le(self.lat);
29842 __tmp.put_i32_le(self.lon);
29843 __tmp.put_i32_le(self.alt);
29844 __tmp.put_i32_le(self.relative_alt);
29845 __tmp.put_i32_le(self.next_lat);
29846 __tmp.put_i32_le(self.next_lon);
29847 __tmp.put_i32_le(self.next_alt);
29848 __tmp.put_i16_le(self.vx);
29849 __tmp.put_i16_le(self.vy);
29850 __tmp.put_i16_le(self.vz);
29851 __tmp.put_u16_le(self.h_acc);
29852 __tmp.put_u16_le(self.v_acc);
29853 __tmp.put_u16_le(self.vel_acc);
29854 __tmp.put_u16_le(self.update_rate);
29855 for val in &self.uas_id {
29856 __tmp.put_u8(*val);
29857 }
29858 __tmp.put_u8(self.flight_state as u8);
29859 __tmp.put_u8(self.flags.bits());
29860 if matches!(version, MavlinkVersion::V2) {
29861 let len = __tmp.len();
29862 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29863 } else {
29864 __tmp.len()
29865 }
29866 }
29867}
29868#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
29869#[doc = ""]
29870#[doc = "ID: 248"]
29871#[derive(Debug, Clone, PartialEq)]
29872#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29874pub struct V2_EXTENSION_DATA {
29875 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
29876 pub message_type: u16,
29877 #[doc = "Network ID (0 for broadcast)"]
29878 pub target_network: u8,
29879 #[doc = "System ID (0 for broadcast)"]
29880 pub target_system: u8,
29881 #[doc = "Component ID (0 for broadcast)"]
29882 pub target_component: u8,
29883 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
29884 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29885 pub payload: [u8; 249],
29886}
29887impl V2_EXTENSION_DATA {
29888 pub const ENCODED_LEN: usize = 254usize;
29889 pub const DEFAULT: Self = Self {
29890 message_type: 0_u16,
29891 target_network: 0_u8,
29892 target_system: 0_u8,
29893 target_component: 0_u8,
29894 payload: [0_u8; 249usize],
29895 };
29896 #[cfg(feature = "arbitrary")]
29897 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29898 use arbitrary::{Arbitrary, Unstructured};
29899 let mut buf = [0u8; 1024];
29900 rng.fill_bytes(&mut buf);
29901 let mut unstructured = Unstructured::new(&buf);
29902 Self::arbitrary(&mut unstructured).unwrap_or_default()
29903 }
29904}
29905impl Default for V2_EXTENSION_DATA {
29906 fn default() -> Self {
29907 Self::DEFAULT.clone()
29908 }
29909}
29910impl MessageData for V2_EXTENSION_DATA {
29911 type Message = MavMessage;
29912 const ID: u32 = 248u32;
29913 const NAME: &'static str = "V2_EXTENSION";
29914 const EXTRA_CRC: u8 = 8u8;
29915 const ENCODED_LEN: usize = 254usize;
29916 fn deser(
29917 _version: MavlinkVersion,
29918 __input: &[u8],
29919 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29920 let avail_len = __input.len();
29921 let mut payload_buf = [0; Self::ENCODED_LEN];
29922 let mut buf = if avail_len < Self::ENCODED_LEN {
29923 payload_buf[0..avail_len].copy_from_slice(__input);
29924 Bytes::new(&payload_buf)
29925 } else {
29926 Bytes::new(__input)
29927 };
29928 let mut __struct = Self::default();
29929 __struct.message_type = buf.get_u16_le();
29930 __struct.target_network = buf.get_u8();
29931 __struct.target_system = buf.get_u8();
29932 __struct.target_component = buf.get_u8();
29933 for v in &mut __struct.payload {
29934 let val = buf.get_u8();
29935 *v = val;
29936 }
29937 Ok(__struct)
29938 }
29939 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29940 let mut __tmp = BytesMut::new(bytes);
29941 #[allow(clippy::absurd_extreme_comparisons)]
29942 #[allow(unused_comparisons)]
29943 if __tmp.remaining() < Self::ENCODED_LEN {
29944 panic!(
29945 "buffer is too small (need {} bytes, but got {})",
29946 Self::ENCODED_LEN,
29947 __tmp.remaining(),
29948 )
29949 }
29950 __tmp.put_u16_le(self.message_type);
29951 __tmp.put_u8(self.target_network);
29952 __tmp.put_u8(self.target_system);
29953 __tmp.put_u8(self.target_component);
29954 for val in &self.payload {
29955 __tmp.put_u8(*val);
29956 }
29957 if matches!(version, MavlinkVersion::V2) {
29958 let len = __tmp.len();
29959 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29960 } else {
29961 __tmp.len()
29962 }
29963 }
29964}
29965#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
29966#[doc = ""]
29967#[doc = "ID: 74"]
29968#[derive(Debug, Clone, PartialEq)]
29969#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29970#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29971pub struct VFR_HUD_DATA {
29972 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
29973 pub airspeed: f32,
29974 #[doc = "Current ground speed."]
29975 pub groundspeed: f32,
29976 #[doc = "Current altitude (MSL)."]
29977 pub alt: f32,
29978 #[doc = "Current climb rate."]
29979 pub climb: f32,
29980 #[doc = "Current heading in compass units (0-360, 0=north)."]
29981 pub heading: i16,
29982 #[doc = "Current throttle setting (0 to 100)."]
29983 pub throttle: u16,
29984}
29985impl VFR_HUD_DATA {
29986 pub const ENCODED_LEN: usize = 20usize;
29987 pub const DEFAULT: Self = Self {
29988 airspeed: 0.0_f32,
29989 groundspeed: 0.0_f32,
29990 alt: 0.0_f32,
29991 climb: 0.0_f32,
29992 heading: 0_i16,
29993 throttle: 0_u16,
29994 };
29995 #[cfg(feature = "arbitrary")]
29996 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29997 use arbitrary::{Arbitrary, Unstructured};
29998 let mut buf = [0u8; 1024];
29999 rng.fill_bytes(&mut buf);
30000 let mut unstructured = Unstructured::new(&buf);
30001 Self::arbitrary(&mut unstructured).unwrap_or_default()
30002 }
30003}
30004impl Default for VFR_HUD_DATA {
30005 fn default() -> Self {
30006 Self::DEFAULT.clone()
30007 }
30008}
30009impl MessageData for VFR_HUD_DATA {
30010 type Message = MavMessage;
30011 const ID: u32 = 74u32;
30012 const NAME: &'static str = "VFR_HUD";
30013 const EXTRA_CRC: u8 = 20u8;
30014 const ENCODED_LEN: usize = 20usize;
30015 fn deser(
30016 _version: MavlinkVersion,
30017 __input: &[u8],
30018 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30019 let avail_len = __input.len();
30020 let mut payload_buf = [0; Self::ENCODED_LEN];
30021 let mut buf = if avail_len < Self::ENCODED_LEN {
30022 payload_buf[0..avail_len].copy_from_slice(__input);
30023 Bytes::new(&payload_buf)
30024 } else {
30025 Bytes::new(__input)
30026 };
30027 let mut __struct = Self::default();
30028 __struct.airspeed = buf.get_f32_le();
30029 __struct.groundspeed = buf.get_f32_le();
30030 __struct.alt = buf.get_f32_le();
30031 __struct.climb = buf.get_f32_le();
30032 __struct.heading = buf.get_i16_le();
30033 __struct.throttle = buf.get_u16_le();
30034 Ok(__struct)
30035 }
30036 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30037 let mut __tmp = BytesMut::new(bytes);
30038 #[allow(clippy::absurd_extreme_comparisons)]
30039 #[allow(unused_comparisons)]
30040 if __tmp.remaining() < Self::ENCODED_LEN {
30041 panic!(
30042 "buffer is too small (need {} bytes, but got {})",
30043 Self::ENCODED_LEN,
30044 __tmp.remaining(),
30045 )
30046 }
30047 __tmp.put_f32_le(self.airspeed);
30048 __tmp.put_f32_le(self.groundspeed);
30049 __tmp.put_f32_le(self.alt);
30050 __tmp.put_f32_le(self.climb);
30051 __tmp.put_i16_le(self.heading);
30052 __tmp.put_u16_le(self.throttle);
30053 if matches!(version, MavlinkVersion::V2) {
30054 let len = __tmp.len();
30055 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30056 } else {
30057 __tmp.len()
30058 }
30059 }
30060}
30061#[doc = "Vibration levels and accelerometer clipping."]
30062#[doc = ""]
30063#[doc = "ID: 241"]
30064#[derive(Debug, Clone, PartialEq)]
30065#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30066#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30067pub struct VIBRATION_DATA {
30068 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30069 pub time_usec: u64,
30070 #[doc = "Vibration levels on X-axis"]
30071 pub vibration_x: f32,
30072 #[doc = "Vibration levels on Y-axis"]
30073 pub vibration_y: f32,
30074 #[doc = "Vibration levels on Z-axis"]
30075 pub vibration_z: f32,
30076 #[doc = "first accelerometer clipping count"]
30077 pub clipping_0: u32,
30078 #[doc = "second accelerometer clipping count"]
30079 pub clipping_1: u32,
30080 #[doc = "third accelerometer clipping count"]
30081 pub clipping_2: u32,
30082}
30083impl VIBRATION_DATA {
30084 pub const ENCODED_LEN: usize = 32usize;
30085 pub const DEFAULT: Self = Self {
30086 time_usec: 0_u64,
30087 vibration_x: 0.0_f32,
30088 vibration_y: 0.0_f32,
30089 vibration_z: 0.0_f32,
30090 clipping_0: 0_u32,
30091 clipping_1: 0_u32,
30092 clipping_2: 0_u32,
30093 };
30094 #[cfg(feature = "arbitrary")]
30095 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30096 use arbitrary::{Arbitrary, Unstructured};
30097 let mut buf = [0u8; 1024];
30098 rng.fill_bytes(&mut buf);
30099 let mut unstructured = Unstructured::new(&buf);
30100 Self::arbitrary(&mut unstructured).unwrap_or_default()
30101 }
30102}
30103impl Default for VIBRATION_DATA {
30104 fn default() -> Self {
30105 Self::DEFAULT.clone()
30106 }
30107}
30108impl MessageData for VIBRATION_DATA {
30109 type Message = MavMessage;
30110 const ID: u32 = 241u32;
30111 const NAME: &'static str = "VIBRATION";
30112 const EXTRA_CRC: u8 = 90u8;
30113 const ENCODED_LEN: usize = 32usize;
30114 fn deser(
30115 _version: MavlinkVersion,
30116 __input: &[u8],
30117 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30118 let avail_len = __input.len();
30119 let mut payload_buf = [0; Self::ENCODED_LEN];
30120 let mut buf = if avail_len < Self::ENCODED_LEN {
30121 payload_buf[0..avail_len].copy_from_slice(__input);
30122 Bytes::new(&payload_buf)
30123 } else {
30124 Bytes::new(__input)
30125 };
30126 let mut __struct = Self::default();
30127 __struct.time_usec = buf.get_u64_le();
30128 __struct.vibration_x = buf.get_f32_le();
30129 __struct.vibration_y = buf.get_f32_le();
30130 __struct.vibration_z = buf.get_f32_le();
30131 __struct.clipping_0 = buf.get_u32_le();
30132 __struct.clipping_1 = buf.get_u32_le();
30133 __struct.clipping_2 = buf.get_u32_le();
30134 Ok(__struct)
30135 }
30136 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30137 let mut __tmp = BytesMut::new(bytes);
30138 #[allow(clippy::absurd_extreme_comparisons)]
30139 #[allow(unused_comparisons)]
30140 if __tmp.remaining() < Self::ENCODED_LEN {
30141 panic!(
30142 "buffer is too small (need {} bytes, but got {})",
30143 Self::ENCODED_LEN,
30144 __tmp.remaining(),
30145 )
30146 }
30147 __tmp.put_u64_le(self.time_usec);
30148 __tmp.put_f32_le(self.vibration_x);
30149 __tmp.put_f32_le(self.vibration_y);
30150 __tmp.put_f32_le(self.vibration_z);
30151 __tmp.put_u32_le(self.clipping_0);
30152 __tmp.put_u32_le(self.clipping_1);
30153 __tmp.put_u32_le(self.clipping_2);
30154 if matches!(version, MavlinkVersion::V2) {
30155 let len = __tmp.len();
30156 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30157 } else {
30158 __tmp.len()
30159 }
30160 }
30161}
30162#[doc = "Global position estimate from a Vicon motion system source."]
30163#[doc = ""]
30164#[doc = "ID: 104"]
30165#[derive(Debug, Clone, PartialEq)]
30166#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30168pub struct VICON_POSITION_ESTIMATE_DATA {
30169 #[doc = "Timestamp (UNIX time or time since system boot)"]
30170 pub usec: u64,
30171 #[doc = "Global X position"]
30172 pub x: f32,
30173 #[doc = "Global Y position"]
30174 pub y: f32,
30175 #[doc = "Global Z position"]
30176 pub z: f32,
30177 #[doc = "Roll angle"]
30178 pub roll: f32,
30179 #[doc = "Pitch angle"]
30180 pub pitch: f32,
30181 #[doc = "Yaw angle"]
30182 pub yaw: f32,
30183 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
30184 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30185 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30186 pub covariance: [f32; 21],
30187}
30188impl VICON_POSITION_ESTIMATE_DATA {
30189 pub const ENCODED_LEN: usize = 116usize;
30190 pub const DEFAULT: Self = Self {
30191 usec: 0_u64,
30192 x: 0.0_f32,
30193 y: 0.0_f32,
30194 z: 0.0_f32,
30195 roll: 0.0_f32,
30196 pitch: 0.0_f32,
30197 yaw: 0.0_f32,
30198 covariance: [0.0_f32; 21usize],
30199 };
30200 #[cfg(feature = "arbitrary")]
30201 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30202 use arbitrary::{Arbitrary, Unstructured};
30203 let mut buf = [0u8; 1024];
30204 rng.fill_bytes(&mut buf);
30205 let mut unstructured = Unstructured::new(&buf);
30206 Self::arbitrary(&mut unstructured).unwrap_or_default()
30207 }
30208}
30209impl Default for VICON_POSITION_ESTIMATE_DATA {
30210 fn default() -> Self {
30211 Self::DEFAULT.clone()
30212 }
30213}
30214impl MessageData for VICON_POSITION_ESTIMATE_DATA {
30215 type Message = MavMessage;
30216 const ID: u32 = 104u32;
30217 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
30218 const EXTRA_CRC: u8 = 56u8;
30219 const ENCODED_LEN: usize = 116usize;
30220 fn deser(
30221 _version: MavlinkVersion,
30222 __input: &[u8],
30223 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30224 let avail_len = __input.len();
30225 let mut payload_buf = [0; Self::ENCODED_LEN];
30226 let mut buf = if avail_len < Self::ENCODED_LEN {
30227 payload_buf[0..avail_len].copy_from_slice(__input);
30228 Bytes::new(&payload_buf)
30229 } else {
30230 Bytes::new(__input)
30231 };
30232 let mut __struct = Self::default();
30233 __struct.usec = buf.get_u64_le();
30234 __struct.x = buf.get_f32_le();
30235 __struct.y = buf.get_f32_le();
30236 __struct.z = buf.get_f32_le();
30237 __struct.roll = buf.get_f32_le();
30238 __struct.pitch = buf.get_f32_le();
30239 __struct.yaw = buf.get_f32_le();
30240 for v in &mut __struct.covariance {
30241 let val = buf.get_f32_le();
30242 *v = val;
30243 }
30244 Ok(__struct)
30245 }
30246 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30247 let mut __tmp = BytesMut::new(bytes);
30248 #[allow(clippy::absurd_extreme_comparisons)]
30249 #[allow(unused_comparisons)]
30250 if __tmp.remaining() < Self::ENCODED_LEN {
30251 panic!(
30252 "buffer is too small (need {} bytes, but got {})",
30253 Self::ENCODED_LEN,
30254 __tmp.remaining(),
30255 )
30256 }
30257 __tmp.put_u64_le(self.usec);
30258 __tmp.put_f32_le(self.x);
30259 __tmp.put_f32_le(self.y);
30260 __tmp.put_f32_le(self.z);
30261 __tmp.put_f32_le(self.roll);
30262 __tmp.put_f32_le(self.pitch);
30263 __tmp.put_f32_le(self.yaw);
30264 if matches!(version, MavlinkVersion::V2) {
30265 for val in &self.covariance {
30266 __tmp.put_f32_le(*val);
30267 }
30268 let len = __tmp.len();
30269 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30270 } else {
30271 __tmp.len()
30272 }
30273 }
30274}
30275#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
30276#[doc = ""]
30277#[doc = "ID: 269"]
30278#[derive(Debug, Clone, PartialEq)]
30279#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30280#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30281pub struct VIDEO_STREAM_INFORMATION_DATA {
30282 #[doc = "Frame rate."]
30283 pub framerate: f32,
30284 #[doc = "Bit rate."]
30285 pub bitrate: u32,
30286 #[doc = "Bitmap of stream status flags."]
30287 pub flags: VideoStreamStatusFlags,
30288 #[doc = "Horizontal resolution."]
30289 pub resolution_h: u16,
30290 #[doc = "Vertical resolution."]
30291 pub resolution_v: u16,
30292 #[doc = "Video image rotation clockwise."]
30293 pub rotation: u16,
30294 #[doc = "Horizontal Field of view."]
30295 pub hfov: u16,
30296 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30297 pub stream_id: u8,
30298 #[doc = "Number of streams available."]
30299 pub count: u8,
30300 #[doc = "Type of stream."]
30301 pub mavtype: VideoStreamType,
30302 #[doc = "Stream name."]
30303 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30304 pub name: [u8; 32],
30305 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
30306 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30307 pub uri: [u8; 160],
30308 #[doc = "Encoding of stream."]
30309 #[cfg_attr(feature = "serde", serde(default))]
30310 pub encoding: VideoStreamEncoding,
30311 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30312 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30313 pub camera_device_id: u8,
30314}
30315impl VIDEO_STREAM_INFORMATION_DATA {
30316 pub const ENCODED_LEN: usize = 215usize;
30317 pub const DEFAULT: Self = Self {
30318 framerate: 0.0_f32,
30319 bitrate: 0_u32,
30320 flags: VideoStreamStatusFlags::DEFAULT,
30321 resolution_h: 0_u16,
30322 resolution_v: 0_u16,
30323 rotation: 0_u16,
30324 hfov: 0_u16,
30325 stream_id: 0_u8,
30326 count: 0_u8,
30327 mavtype: VideoStreamType::DEFAULT,
30328 name: [0_u8; 32usize],
30329 uri: [0_u8; 160usize],
30330 encoding: VideoStreamEncoding::DEFAULT,
30331 camera_device_id: 0_u8,
30332 };
30333 #[cfg(feature = "arbitrary")]
30334 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30335 use arbitrary::{Arbitrary, Unstructured};
30336 let mut buf = [0u8; 1024];
30337 rng.fill_bytes(&mut buf);
30338 let mut unstructured = Unstructured::new(&buf);
30339 Self::arbitrary(&mut unstructured).unwrap_or_default()
30340 }
30341}
30342impl Default for VIDEO_STREAM_INFORMATION_DATA {
30343 fn default() -> Self {
30344 Self::DEFAULT.clone()
30345 }
30346}
30347impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
30348 type Message = MavMessage;
30349 const ID: u32 = 269u32;
30350 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
30351 const EXTRA_CRC: u8 = 109u8;
30352 const ENCODED_LEN: usize = 215usize;
30353 fn deser(
30354 _version: MavlinkVersion,
30355 __input: &[u8],
30356 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30357 let avail_len = __input.len();
30358 let mut payload_buf = [0; Self::ENCODED_LEN];
30359 let mut buf = if avail_len < Self::ENCODED_LEN {
30360 payload_buf[0..avail_len].copy_from_slice(__input);
30361 Bytes::new(&payload_buf)
30362 } else {
30363 Bytes::new(__input)
30364 };
30365 let mut __struct = Self::default();
30366 __struct.framerate = buf.get_f32_le();
30367 __struct.bitrate = buf.get_u32_le();
30368 let tmp = buf.get_u16_le();
30369 __struct.flags = VideoStreamStatusFlags::from_bits(
30370 tmp & VideoStreamStatusFlags::all().bits(),
30371 )
30372 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30373 flag_type: "VideoStreamStatusFlags",
30374 value: tmp as u32,
30375 })?;
30376 __struct.resolution_h = buf.get_u16_le();
30377 __struct.resolution_v = buf.get_u16_le();
30378 __struct.rotation = buf.get_u16_le();
30379 __struct.hfov = buf.get_u16_le();
30380 __struct.stream_id = buf.get_u8();
30381 __struct.count = buf.get_u8();
30382 let tmp = buf.get_u8();
30383 __struct.mavtype =
30384 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30385 enum_type: "VideoStreamType",
30386 value: tmp as u32,
30387 })?;
30388 for v in &mut __struct.name {
30389 let val = buf.get_u8();
30390 *v = val;
30391 }
30392 for v in &mut __struct.uri {
30393 let val = buf.get_u8();
30394 *v = val;
30395 }
30396 let tmp = buf.get_u8();
30397 __struct.encoding =
30398 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30399 enum_type: "VideoStreamEncoding",
30400 value: tmp as u32,
30401 })?;
30402 __struct.camera_device_id = buf.get_u8();
30403 Ok(__struct)
30404 }
30405 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30406 let mut __tmp = BytesMut::new(bytes);
30407 #[allow(clippy::absurd_extreme_comparisons)]
30408 #[allow(unused_comparisons)]
30409 if __tmp.remaining() < Self::ENCODED_LEN {
30410 panic!(
30411 "buffer is too small (need {} bytes, but got {})",
30412 Self::ENCODED_LEN,
30413 __tmp.remaining(),
30414 )
30415 }
30416 __tmp.put_f32_le(self.framerate);
30417 __tmp.put_u32_le(self.bitrate);
30418 __tmp.put_u16_le(self.flags.bits());
30419 __tmp.put_u16_le(self.resolution_h);
30420 __tmp.put_u16_le(self.resolution_v);
30421 __tmp.put_u16_le(self.rotation);
30422 __tmp.put_u16_le(self.hfov);
30423 __tmp.put_u8(self.stream_id);
30424 __tmp.put_u8(self.count);
30425 __tmp.put_u8(self.mavtype as u8);
30426 for val in &self.name {
30427 __tmp.put_u8(*val);
30428 }
30429 for val in &self.uri {
30430 __tmp.put_u8(*val);
30431 }
30432 if matches!(version, MavlinkVersion::V2) {
30433 __tmp.put_u8(self.encoding as u8);
30434 __tmp.put_u8(self.camera_device_id);
30435 let len = __tmp.len();
30436 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30437 } else {
30438 __tmp.len()
30439 }
30440 }
30441}
30442#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
30443#[doc = ""]
30444#[doc = "ID: 270"]
30445#[derive(Debug, Clone, PartialEq)]
30446#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30447#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30448pub struct VIDEO_STREAM_STATUS_DATA {
30449 #[doc = "Frame rate"]
30450 pub framerate: f32,
30451 #[doc = "Bit rate"]
30452 pub bitrate: u32,
30453 #[doc = "Bitmap of stream status flags"]
30454 pub flags: VideoStreamStatusFlags,
30455 #[doc = "Horizontal resolution"]
30456 pub resolution_h: u16,
30457 #[doc = "Vertical resolution"]
30458 pub resolution_v: u16,
30459 #[doc = "Video image rotation clockwise"]
30460 pub rotation: u16,
30461 #[doc = "Horizontal Field of view"]
30462 pub hfov: u16,
30463 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30464 pub stream_id: u8,
30465 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30466 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30467 pub camera_device_id: u8,
30468}
30469impl VIDEO_STREAM_STATUS_DATA {
30470 pub const ENCODED_LEN: usize = 20usize;
30471 pub const DEFAULT: Self = Self {
30472 framerate: 0.0_f32,
30473 bitrate: 0_u32,
30474 flags: VideoStreamStatusFlags::DEFAULT,
30475 resolution_h: 0_u16,
30476 resolution_v: 0_u16,
30477 rotation: 0_u16,
30478 hfov: 0_u16,
30479 stream_id: 0_u8,
30480 camera_device_id: 0_u8,
30481 };
30482 #[cfg(feature = "arbitrary")]
30483 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30484 use arbitrary::{Arbitrary, Unstructured};
30485 let mut buf = [0u8; 1024];
30486 rng.fill_bytes(&mut buf);
30487 let mut unstructured = Unstructured::new(&buf);
30488 Self::arbitrary(&mut unstructured).unwrap_or_default()
30489 }
30490}
30491impl Default for VIDEO_STREAM_STATUS_DATA {
30492 fn default() -> Self {
30493 Self::DEFAULT.clone()
30494 }
30495}
30496impl MessageData for VIDEO_STREAM_STATUS_DATA {
30497 type Message = MavMessage;
30498 const ID: u32 = 270u32;
30499 const NAME: &'static str = "VIDEO_STREAM_STATUS";
30500 const EXTRA_CRC: u8 = 59u8;
30501 const ENCODED_LEN: usize = 20usize;
30502 fn deser(
30503 _version: MavlinkVersion,
30504 __input: &[u8],
30505 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30506 let avail_len = __input.len();
30507 let mut payload_buf = [0; Self::ENCODED_LEN];
30508 let mut buf = if avail_len < Self::ENCODED_LEN {
30509 payload_buf[0..avail_len].copy_from_slice(__input);
30510 Bytes::new(&payload_buf)
30511 } else {
30512 Bytes::new(__input)
30513 };
30514 let mut __struct = Self::default();
30515 __struct.framerate = buf.get_f32_le();
30516 __struct.bitrate = buf.get_u32_le();
30517 let tmp = buf.get_u16_le();
30518 __struct.flags = VideoStreamStatusFlags::from_bits(
30519 tmp & VideoStreamStatusFlags::all().bits(),
30520 )
30521 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30522 flag_type: "VideoStreamStatusFlags",
30523 value: tmp as u32,
30524 })?;
30525 __struct.resolution_h = buf.get_u16_le();
30526 __struct.resolution_v = buf.get_u16_le();
30527 __struct.rotation = buf.get_u16_le();
30528 __struct.hfov = buf.get_u16_le();
30529 __struct.stream_id = buf.get_u8();
30530 __struct.camera_device_id = buf.get_u8();
30531 Ok(__struct)
30532 }
30533 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30534 let mut __tmp = BytesMut::new(bytes);
30535 #[allow(clippy::absurd_extreme_comparisons)]
30536 #[allow(unused_comparisons)]
30537 if __tmp.remaining() < Self::ENCODED_LEN {
30538 panic!(
30539 "buffer is too small (need {} bytes, but got {})",
30540 Self::ENCODED_LEN,
30541 __tmp.remaining(),
30542 )
30543 }
30544 __tmp.put_f32_le(self.framerate);
30545 __tmp.put_u32_le(self.bitrate);
30546 __tmp.put_u16_le(self.flags.bits());
30547 __tmp.put_u16_le(self.resolution_h);
30548 __tmp.put_u16_le(self.resolution_v);
30549 __tmp.put_u16_le(self.rotation);
30550 __tmp.put_u16_le(self.hfov);
30551 __tmp.put_u8(self.stream_id);
30552 if matches!(version, MavlinkVersion::V2) {
30553 __tmp.put_u8(self.camera_device_id);
30554 let len = __tmp.len();
30555 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30556 } else {
30557 __tmp.len()
30558 }
30559 }
30560}
30561#[doc = "Local position/attitude estimate from a vision source."]
30562#[doc = ""]
30563#[doc = "ID: 102"]
30564#[derive(Debug, Clone, PartialEq)]
30565#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30566#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30567pub struct VISION_POSITION_ESTIMATE_DATA {
30568 #[doc = "Timestamp (UNIX time or time since system boot)"]
30569 pub usec: u64,
30570 #[doc = "Local X position"]
30571 pub x: f32,
30572 #[doc = "Local Y position"]
30573 pub y: f32,
30574 #[doc = "Local Z position"]
30575 pub z: f32,
30576 #[doc = "Roll angle"]
30577 pub roll: f32,
30578 #[doc = "Pitch angle"]
30579 pub pitch: f32,
30580 #[doc = "Yaw angle"]
30581 pub yaw: f32,
30582 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
30583 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30584 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30585 pub covariance: [f32; 21],
30586 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
30587 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30588 pub reset_counter: u8,
30589}
30590impl VISION_POSITION_ESTIMATE_DATA {
30591 pub const ENCODED_LEN: usize = 117usize;
30592 pub const DEFAULT: Self = Self {
30593 usec: 0_u64,
30594 x: 0.0_f32,
30595 y: 0.0_f32,
30596 z: 0.0_f32,
30597 roll: 0.0_f32,
30598 pitch: 0.0_f32,
30599 yaw: 0.0_f32,
30600 covariance: [0.0_f32; 21usize],
30601 reset_counter: 0_u8,
30602 };
30603 #[cfg(feature = "arbitrary")]
30604 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30605 use arbitrary::{Arbitrary, Unstructured};
30606 let mut buf = [0u8; 1024];
30607 rng.fill_bytes(&mut buf);
30608 let mut unstructured = Unstructured::new(&buf);
30609 Self::arbitrary(&mut unstructured).unwrap_or_default()
30610 }
30611}
30612impl Default for VISION_POSITION_ESTIMATE_DATA {
30613 fn default() -> Self {
30614 Self::DEFAULT.clone()
30615 }
30616}
30617impl MessageData for VISION_POSITION_ESTIMATE_DATA {
30618 type Message = MavMessage;
30619 const ID: u32 = 102u32;
30620 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
30621 const EXTRA_CRC: u8 = 158u8;
30622 const ENCODED_LEN: usize = 117usize;
30623 fn deser(
30624 _version: MavlinkVersion,
30625 __input: &[u8],
30626 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30627 let avail_len = __input.len();
30628 let mut payload_buf = [0; Self::ENCODED_LEN];
30629 let mut buf = if avail_len < Self::ENCODED_LEN {
30630 payload_buf[0..avail_len].copy_from_slice(__input);
30631 Bytes::new(&payload_buf)
30632 } else {
30633 Bytes::new(__input)
30634 };
30635 let mut __struct = Self::default();
30636 __struct.usec = buf.get_u64_le();
30637 __struct.x = buf.get_f32_le();
30638 __struct.y = buf.get_f32_le();
30639 __struct.z = buf.get_f32_le();
30640 __struct.roll = buf.get_f32_le();
30641 __struct.pitch = buf.get_f32_le();
30642 __struct.yaw = buf.get_f32_le();
30643 for v in &mut __struct.covariance {
30644 let val = buf.get_f32_le();
30645 *v = val;
30646 }
30647 __struct.reset_counter = buf.get_u8();
30648 Ok(__struct)
30649 }
30650 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30651 let mut __tmp = BytesMut::new(bytes);
30652 #[allow(clippy::absurd_extreme_comparisons)]
30653 #[allow(unused_comparisons)]
30654 if __tmp.remaining() < Self::ENCODED_LEN {
30655 panic!(
30656 "buffer is too small (need {} bytes, but got {})",
30657 Self::ENCODED_LEN,
30658 __tmp.remaining(),
30659 )
30660 }
30661 __tmp.put_u64_le(self.usec);
30662 __tmp.put_f32_le(self.x);
30663 __tmp.put_f32_le(self.y);
30664 __tmp.put_f32_le(self.z);
30665 __tmp.put_f32_le(self.roll);
30666 __tmp.put_f32_le(self.pitch);
30667 __tmp.put_f32_le(self.yaw);
30668 if matches!(version, MavlinkVersion::V2) {
30669 for val in &self.covariance {
30670 __tmp.put_f32_le(*val);
30671 }
30672 __tmp.put_u8(self.reset_counter);
30673 let len = __tmp.len();
30674 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30675 } else {
30676 __tmp.len()
30677 }
30678 }
30679}
30680#[doc = "Speed estimate from a vision source."]
30681#[doc = ""]
30682#[doc = "ID: 103"]
30683#[derive(Debug, Clone, PartialEq)]
30684#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30685#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30686pub struct VISION_SPEED_ESTIMATE_DATA {
30687 #[doc = "Timestamp (UNIX time or time since system boot)"]
30688 pub usec: u64,
30689 #[doc = "Global X speed"]
30690 pub x: f32,
30691 #[doc = "Global Y speed"]
30692 pub y: f32,
30693 #[doc = "Global Z speed"]
30694 pub z: f32,
30695 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
30696 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30697 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30698 pub covariance: [f32; 9],
30699 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
30700 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30701 pub reset_counter: u8,
30702}
30703impl VISION_SPEED_ESTIMATE_DATA {
30704 pub const ENCODED_LEN: usize = 57usize;
30705 pub const DEFAULT: Self = Self {
30706 usec: 0_u64,
30707 x: 0.0_f32,
30708 y: 0.0_f32,
30709 z: 0.0_f32,
30710 covariance: [0.0_f32; 9usize],
30711 reset_counter: 0_u8,
30712 };
30713 #[cfg(feature = "arbitrary")]
30714 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30715 use arbitrary::{Arbitrary, Unstructured};
30716 let mut buf = [0u8; 1024];
30717 rng.fill_bytes(&mut buf);
30718 let mut unstructured = Unstructured::new(&buf);
30719 Self::arbitrary(&mut unstructured).unwrap_or_default()
30720 }
30721}
30722impl Default for VISION_SPEED_ESTIMATE_DATA {
30723 fn default() -> Self {
30724 Self::DEFAULT.clone()
30725 }
30726}
30727impl MessageData for VISION_SPEED_ESTIMATE_DATA {
30728 type Message = MavMessage;
30729 const ID: u32 = 103u32;
30730 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
30731 const EXTRA_CRC: u8 = 208u8;
30732 const ENCODED_LEN: usize = 57usize;
30733 fn deser(
30734 _version: MavlinkVersion,
30735 __input: &[u8],
30736 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30737 let avail_len = __input.len();
30738 let mut payload_buf = [0; Self::ENCODED_LEN];
30739 let mut buf = if avail_len < Self::ENCODED_LEN {
30740 payload_buf[0..avail_len].copy_from_slice(__input);
30741 Bytes::new(&payload_buf)
30742 } else {
30743 Bytes::new(__input)
30744 };
30745 let mut __struct = Self::default();
30746 __struct.usec = buf.get_u64_le();
30747 __struct.x = buf.get_f32_le();
30748 __struct.y = buf.get_f32_le();
30749 __struct.z = buf.get_f32_le();
30750 for v in &mut __struct.covariance {
30751 let val = buf.get_f32_le();
30752 *v = val;
30753 }
30754 __struct.reset_counter = buf.get_u8();
30755 Ok(__struct)
30756 }
30757 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30758 let mut __tmp = BytesMut::new(bytes);
30759 #[allow(clippy::absurd_extreme_comparisons)]
30760 #[allow(unused_comparisons)]
30761 if __tmp.remaining() < Self::ENCODED_LEN {
30762 panic!(
30763 "buffer is too small (need {} bytes, but got {})",
30764 Self::ENCODED_LEN,
30765 __tmp.remaining(),
30766 )
30767 }
30768 __tmp.put_u64_le(self.usec);
30769 __tmp.put_f32_le(self.x);
30770 __tmp.put_f32_le(self.y);
30771 __tmp.put_f32_le(self.z);
30772 if matches!(version, MavlinkVersion::V2) {
30773 for val in &self.covariance {
30774 __tmp.put_f32_le(*val);
30775 }
30776 __tmp.put_u8(self.reset_counter);
30777 let len = __tmp.len();
30778 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30779 } else {
30780 __tmp.len()
30781 }
30782 }
30783}
30784#[doc = "Cumulative distance traveled for each reported wheel."]
30785#[doc = ""]
30786#[doc = "ID: 9000"]
30787#[derive(Debug, Clone, PartialEq)]
30788#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30789#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30790pub struct WHEEL_DISTANCE_DATA {
30791 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
30792 pub time_usec: u64,
30793 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
30794 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30795 pub distance: [f64; 16],
30796 #[doc = "Number of wheels reported."]
30797 pub count: u8,
30798}
30799impl WHEEL_DISTANCE_DATA {
30800 pub const ENCODED_LEN: usize = 137usize;
30801 pub const DEFAULT: Self = Self {
30802 time_usec: 0_u64,
30803 distance: [0.0_f64; 16usize],
30804 count: 0_u8,
30805 };
30806 #[cfg(feature = "arbitrary")]
30807 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30808 use arbitrary::{Arbitrary, Unstructured};
30809 let mut buf = [0u8; 1024];
30810 rng.fill_bytes(&mut buf);
30811 let mut unstructured = Unstructured::new(&buf);
30812 Self::arbitrary(&mut unstructured).unwrap_or_default()
30813 }
30814}
30815impl Default for WHEEL_DISTANCE_DATA {
30816 fn default() -> Self {
30817 Self::DEFAULT.clone()
30818 }
30819}
30820impl MessageData for WHEEL_DISTANCE_DATA {
30821 type Message = MavMessage;
30822 const ID: u32 = 9000u32;
30823 const NAME: &'static str = "WHEEL_DISTANCE";
30824 const EXTRA_CRC: u8 = 113u8;
30825 const ENCODED_LEN: usize = 137usize;
30826 fn deser(
30827 _version: MavlinkVersion,
30828 __input: &[u8],
30829 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30830 let avail_len = __input.len();
30831 let mut payload_buf = [0; Self::ENCODED_LEN];
30832 let mut buf = if avail_len < Self::ENCODED_LEN {
30833 payload_buf[0..avail_len].copy_from_slice(__input);
30834 Bytes::new(&payload_buf)
30835 } else {
30836 Bytes::new(__input)
30837 };
30838 let mut __struct = Self::default();
30839 __struct.time_usec = buf.get_u64_le();
30840 for v in &mut __struct.distance {
30841 let val = buf.get_f64_le();
30842 *v = val;
30843 }
30844 __struct.count = buf.get_u8();
30845 Ok(__struct)
30846 }
30847 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30848 let mut __tmp = BytesMut::new(bytes);
30849 #[allow(clippy::absurd_extreme_comparisons)]
30850 #[allow(unused_comparisons)]
30851 if __tmp.remaining() < Self::ENCODED_LEN {
30852 panic!(
30853 "buffer is too small (need {} bytes, but got {})",
30854 Self::ENCODED_LEN,
30855 __tmp.remaining(),
30856 )
30857 }
30858 __tmp.put_u64_le(self.time_usec);
30859 for val in &self.distance {
30860 __tmp.put_f64_le(*val);
30861 }
30862 __tmp.put_u8(self.count);
30863 if matches!(version, MavlinkVersion::V2) {
30864 let len = __tmp.len();
30865 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30866 } else {
30867 __tmp.len()
30868 }
30869 }
30870}
30871#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
30872#[doc = ""]
30873#[doc = "ID: 299"]
30874#[derive(Debug, Clone, PartialEq)]
30875#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30876#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30877pub struct WIFI_CONFIG_AP_DATA {
30878 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
30879 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30880 pub ssid: [u8; 32],
30881 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
30882 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30883 pub password: [u8; 64],
30884 #[doc = "WiFi Mode."]
30885 #[cfg_attr(feature = "serde", serde(default))]
30886 pub mode: WifiConfigApMode,
30887 #[doc = "Message acceptance response (sent back to GS)."]
30888 #[cfg_attr(feature = "serde", serde(default))]
30889 pub response: WifiConfigApResponse,
30890}
30891impl WIFI_CONFIG_AP_DATA {
30892 pub const ENCODED_LEN: usize = 98usize;
30893 pub const DEFAULT: Self = Self {
30894 ssid: [0_u8; 32usize],
30895 password: [0_u8; 64usize],
30896 mode: WifiConfigApMode::DEFAULT,
30897 response: WifiConfigApResponse::DEFAULT,
30898 };
30899 #[cfg(feature = "arbitrary")]
30900 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30901 use arbitrary::{Arbitrary, Unstructured};
30902 let mut buf = [0u8; 1024];
30903 rng.fill_bytes(&mut buf);
30904 let mut unstructured = Unstructured::new(&buf);
30905 Self::arbitrary(&mut unstructured).unwrap_or_default()
30906 }
30907}
30908impl Default for WIFI_CONFIG_AP_DATA {
30909 fn default() -> Self {
30910 Self::DEFAULT.clone()
30911 }
30912}
30913impl MessageData for WIFI_CONFIG_AP_DATA {
30914 type Message = MavMessage;
30915 const ID: u32 = 299u32;
30916 const NAME: &'static str = "WIFI_CONFIG_AP";
30917 const EXTRA_CRC: u8 = 19u8;
30918 const ENCODED_LEN: usize = 98usize;
30919 fn deser(
30920 _version: MavlinkVersion,
30921 __input: &[u8],
30922 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30923 let avail_len = __input.len();
30924 let mut payload_buf = [0; Self::ENCODED_LEN];
30925 let mut buf = if avail_len < Self::ENCODED_LEN {
30926 payload_buf[0..avail_len].copy_from_slice(__input);
30927 Bytes::new(&payload_buf)
30928 } else {
30929 Bytes::new(__input)
30930 };
30931 let mut __struct = Self::default();
30932 for v in &mut __struct.ssid {
30933 let val = buf.get_u8();
30934 *v = val;
30935 }
30936 for v in &mut __struct.password {
30937 let val = buf.get_u8();
30938 *v = val;
30939 }
30940 let tmp = buf.get_i8();
30941 __struct.mode =
30942 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30943 enum_type: "WifiConfigApMode",
30944 value: tmp as u32,
30945 })?;
30946 let tmp = buf.get_i8();
30947 __struct.response =
30948 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30949 enum_type: "WifiConfigApResponse",
30950 value: tmp as u32,
30951 })?;
30952 Ok(__struct)
30953 }
30954 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30955 let mut __tmp = BytesMut::new(bytes);
30956 #[allow(clippy::absurd_extreme_comparisons)]
30957 #[allow(unused_comparisons)]
30958 if __tmp.remaining() < Self::ENCODED_LEN {
30959 panic!(
30960 "buffer is too small (need {} bytes, but got {})",
30961 Self::ENCODED_LEN,
30962 __tmp.remaining(),
30963 )
30964 }
30965 for val in &self.ssid {
30966 __tmp.put_u8(*val);
30967 }
30968 for val in &self.password {
30969 __tmp.put_u8(*val);
30970 }
30971 if matches!(version, MavlinkVersion::V2) {
30972 __tmp.put_i8(self.mode as i8);
30973 __tmp.put_i8(self.response as i8);
30974 let len = __tmp.len();
30975 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30976 } else {
30977 __tmp.len()
30978 }
30979 }
30980}
30981#[doc = "Winch status."]
30982#[doc = ""]
30983#[doc = "ID: 9005"]
30984#[derive(Debug, Clone, PartialEq)]
30985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30987pub struct WINCH_STATUS_DATA {
30988 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
30989 pub time_usec: u64,
30990 #[doc = "Length of line released. NaN if unknown"]
30991 pub line_length: f32,
30992 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
30993 pub speed: f32,
30994 #[doc = "Tension on the line. NaN if unknown"]
30995 pub tension: f32,
30996 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
30997 pub voltage: f32,
30998 #[doc = "Current draw from the winch. NaN if unknown"]
30999 pub current: f32,
31000 #[doc = "Status flags"]
31001 pub status: MavWinchStatusFlag,
31002 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
31003 pub temperature: i16,
31004}
31005impl WINCH_STATUS_DATA {
31006 pub const ENCODED_LEN: usize = 34usize;
31007 pub const DEFAULT: Self = Self {
31008 time_usec: 0_u64,
31009 line_length: 0.0_f32,
31010 speed: 0.0_f32,
31011 tension: 0.0_f32,
31012 voltage: 0.0_f32,
31013 current: 0.0_f32,
31014 status: MavWinchStatusFlag::DEFAULT,
31015 temperature: 0_i16,
31016 };
31017 #[cfg(feature = "arbitrary")]
31018 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31019 use arbitrary::{Arbitrary, Unstructured};
31020 let mut buf = [0u8; 1024];
31021 rng.fill_bytes(&mut buf);
31022 let mut unstructured = Unstructured::new(&buf);
31023 Self::arbitrary(&mut unstructured).unwrap_or_default()
31024 }
31025}
31026impl Default for WINCH_STATUS_DATA {
31027 fn default() -> Self {
31028 Self::DEFAULT.clone()
31029 }
31030}
31031impl MessageData for WINCH_STATUS_DATA {
31032 type Message = MavMessage;
31033 const ID: u32 = 9005u32;
31034 const NAME: &'static str = "WINCH_STATUS";
31035 const EXTRA_CRC: u8 = 117u8;
31036 const ENCODED_LEN: usize = 34usize;
31037 fn deser(
31038 _version: MavlinkVersion,
31039 __input: &[u8],
31040 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31041 let avail_len = __input.len();
31042 let mut payload_buf = [0; Self::ENCODED_LEN];
31043 let mut buf = if avail_len < Self::ENCODED_LEN {
31044 payload_buf[0..avail_len].copy_from_slice(__input);
31045 Bytes::new(&payload_buf)
31046 } else {
31047 Bytes::new(__input)
31048 };
31049 let mut __struct = Self::default();
31050 __struct.time_usec = buf.get_u64_le();
31051 __struct.line_length = buf.get_f32_le();
31052 __struct.speed = buf.get_f32_le();
31053 __struct.tension = buf.get_f32_le();
31054 __struct.voltage = buf.get_f32_le();
31055 __struct.current = buf.get_f32_le();
31056 let tmp = buf.get_u32_le();
31057 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
31058 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31059 flag_type: "MavWinchStatusFlag",
31060 value: tmp as u32,
31061 })?;
31062 __struct.temperature = buf.get_i16_le();
31063 Ok(__struct)
31064 }
31065 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31066 let mut __tmp = BytesMut::new(bytes);
31067 #[allow(clippy::absurd_extreme_comparisons)]
31068 #[allow(unused_comparisons)]
31069 if __tmp.remaining() < Self::ENCODED_LEN {
31070 panic!(
31071 "buffer is too small (need {} bytes, but got {})",
31072 Self::ENCODED_LEN,
31073 __tmp.remaining(),
31074 )
31075 }
31076 __tmp.put_u64_le(self.time_usec);
31077 __tmp.put_f32_le(self.line_length);
31078 __tmp.put_f32_le(self.speed);
31079 __tmp.put_f32_le(self.tension);
31080 __tmp.put_f32_le(self.voltage);
31081 __tmp.put_f32_le(self.current);
31082 __tmp.put_u32_le(self.status.bits());
31083 __tmp.put_i16_le(self.temperature);
31084 if matches!(version, MavlinkVersion::V2) {
31085 let len = __tmp.len();
31086 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31087 } else {
31088 __tmp.len()
31089 }
31090 }
31091}
31092#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
31093#[doc = ""]
31094#[doc = "ID: 231"]
31095#[derive(Debug, Clone, PartialEq)]
31096#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31097#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31098pub struct WIND_COV_DATA {
31099 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31100 pub time_usec: u64,
31101 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
31102 pub wind_x: f32,
31103 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
31104 pub wind_y: f32,
31105 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
31106 pub wind_z: f32,
31107 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31108 pub var_horiz: f32,
31109 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31110 pub var_vert: f32,
31111 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
31112 pub wind_alt: f32,
31113 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
31114 pub horiz_accuracy: f32,
31115 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
31116 pub vert_accuracy: f32,
31117}
31118impl WIND_COV_DATA {
31119 pub const ENCODED_LEN: usize = 40usize;
31120 pub const DEFAULT: Self = Self {
31121 time_usec: 0_u64,
31122 wind_x: 0.0_f32,
31123 wind_y: 0.0_f32,
31124 wind_z: 0.0_f32,
31125 var_horiz: 0.0_f32,
31126 var_vert: 0.0_f32,
31127 wind_alt: 0.0_f32,
31128 horiz_accuracy: 0.0_f32,
31129 vert_accuracy: 0.0_f32,
31130 };
31131 #[cfg(feature = "arbitrary")]
31132 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31133 use arbitrary::{Arbitrary, Unstructured};
31134 let mut buf = [0u8; 1024];
31135 rng.fill_bytes(&mut buf);
31136 let mut unstructured = Unstructured::new(&buf);
31137 Self::arbitrary(&mut unstructured).unwrap_or_default()
31138 }
31139}
31140impl Default for WIND_COV_DATA {
31141 fn default() -> Self {
31142 Self::DEFAULT.clone()
31143 }
31144}
31145impl MessageData for WIND_COV_DATA {
31146 type Message = MavMessage;
31147 const ID: u32 = 231u32;
31148 const NAME: &'static str = "WIND_COV";
31149 const EXTRA_CRC: u8 = 105u8;
31150 const ENCODED_LEN: usize = 40usize;
31151 fn deser(
31152 _version: MavlinkVersion,
31153 __input: &[u8],
31154 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31155 let avail_len = __input.len();
31156 let mut payload_buf = [0; Self::ENCODED_LEN];
31157 let mut buf = if avail_len < Self::ENCODED_LEN {
31158 payload_buf[0..avail_len].copy_from_slice(__input);
31159 Bytes::new(&payload_buf)
31160 } else {
31161 Bytes::new(__input)
31162 };
31163 let mut __struct = Self::default();
31164 __struct.time_usec = buf.get_u64_le();
31165 __struct.wind_x = buf.get_f32_le();
31166 __struct.wind_y = buf.get_f32_le();
31167 __struct.wind_z = buf.get_f32_le();
31168 __struct.var_horiz = buf.get_f32_le();
31169 __struct.var_vert = buf.get_f32_le();
31170 __struct.wind_alt = buf.get_f32_le();
31171 __struct.horiz_accuracy = buf.get_f32_le();
31172 __struct.vert_accuracy = buf.get_f32_le();
31173 Ok(__struct)
31174 }
31175 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31176 let mut __tmp = BytesMut::new(bytes);
31177 #[allow(clippy::absurd_extreme_comparisons)]
31178 #[allow(unused_comparisons)]
31179 if __tmp.remaining() < Self::ENCODED_LEN {
31180 panic!(
31181 "buffer is too small (need {} bytes, but got {})",
31182 Self::ENCODED_LEN,
31183 __tmp.remaining(),
31184 )
31185 }
31186 __tmp.put_u64_le(self.time_usec);
31187 __tmp.put_f32_le(self.wind_x);
31188 __tmp.put_f32_le(self.wind_y);
31189 __tmp.put_f32_le(self.wind_z);
31190 __tmp.put_f32_le(self.var_horiz);
31191 __tmp.put_f32_le(self.var_vert);
31192 __tmp.put_f32_le(self.wind_alt);
31193 __tmp.put_f32_le(self.horiz_accuracy);
31194 __tmp.put_f32_le(self.vert_accuracy);
31195 if matches!(version, MavlinkVersion::V2) {
31196 let len = __tmp.len();
31197 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31198 } else {
31199 __tmp.len()
31200 }
31201 }
31202}
31203#[derive(Clone, PartialEq, Debug)]
31204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31205#[cfg_attr(feature = "serde", serde(tag = "type"))]
31206#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31207#[repr(u32)]
31208pub enum MavMessage {
31209 #[doc = "Set the vehicle attitude and body angular rates."]
31210 #[doc = ""]
31211 #[doc = "ID: 140"]
31212 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
31213 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
31214 #[doc = ""]
31215 #[doc = "ID: 375"]
31216 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
31217 #[doc = "The location and information of an ADSB vehicle."]
31218 #[doc = ""]
31219 #[doc = "ID: 246"]
31220 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
31221 #[doc = "The location and information of an AIS vessel."]
31222 #[doc = ""]
31223 #[doc = "ID: 301"]
31224 AIS_VESSEL(AIS_VESSEL_DATA),
31225 #[doc = "The current system altitude."]
31226 #[doc = ""]
31227 #[doc = "ID: 141"]
31228 ALTITUDE(ALTITUDE_DATA),
31229 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
31230 #[doc = ""]
31231 #[doc = "ID: 30"]
31232 ATTITUDE(ATTITUDE_DATA),
31233 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
31234 #[doc = ""]
31235 #[doc = "ID: 31"]
31236 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
31237 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
31238 #[doc = ""]
31239 #[doc = "ID: 61"]
31240 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
31241 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
31242 #[doc = ""]
31243 #[doc = "ID: 83"]
31244 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
31245 #[doc = "Motion capture attitude and position."]
31246 #[doc = ""]
31247 #[doc = "ID: 138"]
31248 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
31249 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
31250 #[doc = ""]
31251 #[doc = "ID: 7"]
31252 AUTH_KEY(AUTH_KEY_DATA),
31253 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
31254 #[doc = ""]
31255 #[doc = "ID: 286"]
31256 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
31257 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
31258 #[doc = ""]
31259 #[doc = "ID: 148"]
31260 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
31261 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
31262 #[doc = ""]
31263 #[doc = "ID: 435"]
31264 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
31265 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
31266 #[doc = ""]
31267 #[doc = "ID: 437"]
31268 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
31269 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
31270 #[doc = ""]
31271 #[doc = "ID: 372"]
31272 BATTERY_INFO(BATTERY_INFO_DATA),
31273 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
31274 #[doc = ""]
31275 #[doc = "ID: 147"]
31276 BATTERY_STATUS(BATTERY_STATUS_DATA),
31277 #[doc = "Report button state change."]
31278 #[doc = ""]
31279 #[doc = "ID: 257"]
31280 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
31281 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31282 #[doc = ""]
31283 #[doc = "ID: 262"]
31284 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
31285 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31286 #[doc = ""]
31287 #[doc = "ID: 271"]
31288 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
31289 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
31290 #[doc = ""]
31291 #[doc = "ID: 263"]
31292 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
31293 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31294 #[doc = ""]
31295 #[doc = "ID: 259"]
31296 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
31297 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31298 #[doc = ""]
31299 #[doc = "ID: 260"]
31300 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
31301 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
31302 #[doc = ""]
31303 #[doc = "ID: 277"]
31304 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
31305 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
31306 #[doc = ""]
31307 #[doc = "ID: 276"]
31308 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
31309 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
31310 #[doc = ""]
31311 #[doc = "ID: 275"]
31312 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
31313 #[doc = "Camera-IMU triggering and synchronisation message."]
31314 #[doc = ""]
31315 #[doc = "ID: 112"]
31316 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
31317 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
31318 #[doc = ""]
31319 #[doc = "ID: 387"]
31320 CANFD_FRAME(CANFD_FRAME_DATA),
31321 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
31322 #[doc = ""]
31323 #[doc = "ID: 388"]
31324 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
31325 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
31326 #[doc = ""]
31327 #[doc = "ID: 386"]
31328 CAN_FRAME(CAN_FRAME_DATA),
31329 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
31330 #[doc = ""]
31331 #[doc = "ID: 336"]
31332 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
31333 #[doc = "Report current used cellular network status."]
31334 #[doc = ""]
31335 #[doc = "ID: 334"]
31336 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
31337 #[doc = "Request to control this MAV."]
31338 #[doc = ""]
31339 #[doc = "ID: 5"]
31340 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
31341 #[doc = "Accept / deny control of this MAV."]
31342 #[doc = ""]
31343 #[doc = "ID: 6"]
31344 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
31345 #[doc = "Information about a potential collision."]
31346 #[doc = ""]
31347 #[doc = "ID: 247"]
31348 COLLISION(COLLISION_DATA),
31349 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31350 #[doc = ""]
31351 #[doc = "ID: 77"]
31352 COMMAND_ACK(COMMAND_ACK_DATA),
31353 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31354 #[doc = ""]
31355 #[doc = "ID: 80"]
31356 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
31357 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31358 #[doc = ""]
31359 #[doc = "ID: 75"]
31360 COMMAND_INT(COMMAND_INT_DATA),
31361 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31362 #[doc = ""]
31363 #[doc = "ID: 76"]
31364 COMMAND_LONG(COMMAND_LONG_DATA),
31365 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
31366 #[doc = ""]
31367 #[doc = "ID: 395"]
31368 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
31369 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
31370 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
31371 #[doc = ""]
31372 #[doc = "ID: 396"]
31373 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
31374 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
31375 #[doc = ""]
31376 #[doc = "ID: 397"]
31377 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
31378 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
31379 #[doc = ""]
31380 #[doc = "ID: 146"]
31381 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
31382 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
31383 #[doc = ""]
31384 #[doc = "ID: 411"]
31385 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
31386 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
31387 #[doc = ""]
31388 #[doc = "ID: 436"]
31389 CURRENT_MODE(CURRENT_MODE_DATA),
31390 #[doc = "Data stream status information."]
31391 #[doc = ""]
31392 #[doc = "ID: 67"]
31393 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
31394 DATA_STREAM(DATA_STREAM_DATA),
31395 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
31396 #[doc = ""]
31397 #[doc = "ID: 130"]
31398 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
31399 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
31400 #[doc = ""]
31401 #[doc = "ID: 254"]
31402 DEBUG(DEBUG_DATA),
31403 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
31404 #[doc = ""]
31405 #[doc = "ID: 350"]
31406 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
31407 #[doc = "To debug something using a named 3D vector."]
31408 #[doc = ""]
31409 #[doc = "ID: 250"]
31410 DEBUG_VECT(DEBUG_VECT_DATA),
31411 #[doc = "Distance sensor information for an onboard rangefinder."]
31412 #[doc = ""]
31413 #[doc = "ID: 132"]
31414 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
31415 #[doc = "EFI status output."]
31416 #[doc = ""]
31417 #[doc = "ID: 225"]
31418 EFI_STATUS(EFI_STATUS_DATA),
31419 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
31420 #[doc = ""]
31421 #[doc = "ID: 131"]
31422 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
31423 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
31424 #[doc = ""]
31425 #[doc = "ID: 290"]
31426 ESC_INFO(ESC_INFO_DATA),
31427 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
31428 #[doc = ""]
31429 #[doc = "ID: 291"]
31430 ESC_STATUS(ESC_STATUS_DATA),
31431 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
31432 #[doc = ""]
31433 #[doc = "ID: 230"]
31434 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
31435 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
31436 #[doc = ""]
31437 #[doc = "ID: 410"]
31438 EVENT(EVENT_DATA),
31439 #[doc = "Provides state for additional features."]
31440 #[doc = ""]
31441 #[doc = "ID: 245"]
31442 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
31443 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
31444 #[doc = ""]
31445 #[doc = "ID: 162"]
31446 FENCE_STATUS(FENCE_STATUS_DATA),
31447 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
31448 #[doc = ""]
31449 #[doc = "ID: 110"]
31450 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
31451 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
31452 #[doc = ""]
31453 #[doc = "ID: 264"]
31454 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
31455 #[doc = "Current motion information from a designated system."]
31456 #[doc = ""]
31457 #[doc = "ID: 144"]
31458 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
31459 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
31460 #[doc = ""]
31461 #[doc = "ID: 371"]
31462 FUEL_STATUS(FUEL_STATUS_DATA),
31463 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
31464 #[doc = ""]
31465 #[doc = "ID: 373"]
31466 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
31467 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
31468 #[doc = ""]
31469 #[doc = "ID: 285"]
31470 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
31471 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
31472 #[doc = ""]
31473 #[doc = "ID: 283"]
31474 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
31475 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
31476 #[doc = ""]
31477 #[doc = "ID: 284"]
31478 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
31479 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
31480 #[doc = ""]
31481 #[doc = "ID: 280"]
31482 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
31483 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
31484 #[doc = ""]
31485 #[doc = "ID: 282"]
31486 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
31487 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
31488 #[doc = ""]
31489 #[doc = "ID: 288"]
31490 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
31491 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
31492 #[doc = ""]
31493 #[doc = "ID: 287"]
31494 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
31495 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
31496 #[doc = ""]
31497 #[doc = "ID: 281"]
31498 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
31499 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
31500 #[doc = ""]
31501 #[doc = "ID: 33"]
31502 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
31503 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
31504 #[doc = ""]
31505 #[doc = "ID: 63"]
31506 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
31507 #[doc = "Global position/attitude estimate from a vision source."]
31508 #[doc = ""]
31509 #[doc = "ID: 101"]
31510 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
31511 #[doc = "Second GPS data."]
31512 #[doc = ""]
31513 #[doc = "ID: 124"]
31514 GPS2_RAW(GPS2_RAW_DATA),
31515 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
31516 #[doc = ""]
31517 #[doc = "ID: 128"]
31518 GPS2_RTK(GPS2_RTK_DATA),
31519 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
31520 #[doc = ""]
31521 #[doc = "ID: 49"]
31522 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
31523 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
31524 #[doc = ""]
31525 #[doc = "ID: 123"]
31526 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
31527 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
31528 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
31529 #[doc = ""]
31530 #[doc = "ID: 232"]
31531 GPS_INPUT(GPS_INPUT_DATA),
31532 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
31533 #[doc = ""]
31534 #[doc = "ID: 24"]
31535 GPS_RAW_INT(GPS_RAW_INT_DATA),
31536 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
31537 #[doc = ""]
31538 #[doc = "ID: 233"]
31539 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
31540 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
31541 #[doc = ""]
31542 #[doc = "ID: 127"]
31543 GPS_RTK(GPS_RTK_DATA),
31544 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
31545 #[doc = ""]
31546 #[doc = "ID: 25"]
31547 GPS_STATUS(GPS_STATUS_DATA),
31548 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
31549 #[doc = ""]
31550 #[doc = "ID: 0"]
31551 HEARTBEAT(HEARTBEAT_DATA),
31552 #[doc = "The IMU readings in SI units in NED body frame."]
31553 #[doc = ""]
31554 #[doc = "ID: 105"]
31555 HIGHRES_IMU(HIGHRES_IMU_DATA),
31556 #[doc = "Message appropriate for high latency connections like Iridium."]
31557 #[doc = ""]
31558 #[doc = "ID: 234"]
31559 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
31560 HIGH_LATENCY(HIGH_LATENCY_DATA),
31561 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
31562 #[doc = ""]
31563 #[doc = "ID: 235"]
31564 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
31565 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
31566 #[doc = ""]
31567 #[doc = "ID: 93"]
31568 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
31569 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
31570 #[doc = ""]
31571 #[doc = "ID: 91"]
31572 HIL_CONTROLS(HIL_CONTROLS_DATA),
31573 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
31574 #[doc = ""]
31575 #[doc = "ID: 113"]
31576 HIL_GPS(HIL_GPS_DATA),
31577 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
31578 #[doc = ""]
31579 #[doc = "ID: 114"]
31580 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
31581 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
31582 #[doc = ""]
31583 #[doc = "ID: 92"]
31584 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
31585 #[doc = "The IMU readings in SI units in NED body frame."]
31586 #[doc = ""]
31587 #[doc = "ID: 107"]
31588 HIL_SENSOR(HIL_SENSOR_DATA),
31589 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
31590 #[doc = ""]
31591 #[doc = "ID: 90"]
31592 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
31593 HIL_STATE(HIL_STATE_DATA),
31594 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
31595 #[doc = ""]
31596 #[doc = "ID: 115"]
31597 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
31598 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
31599 #[doc = ""]
31600 #[doc = "ID: 242"]
31601 HOME_POSITION(HOME_POSITION_DATA),
31602 #[doc = "Temperature and humidity from hygrometer."]
31603 #[doc = ""]
31604 #[doc = "ID: 12920"]
31605 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
31606 #[doc = "Illuminator status."]
31607 #[doc = ""]
31608 #[doc = "ID: 440"]
31609 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
31610 #[doc = "Status of the Iridium SBD link."]
31611 #[doc = ""]
31612 #[doc = "ID: 335"]
31613 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
31614 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
31615 #[doc = ""]
31616 #[doc = "ID: 149"]
31617 LANDING_TARGET(LANDING_TARGET_DATA),
31618 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
31619 #[doc = ""]
31620 #[doc = "ID: 8"]
31621 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
31622 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
31623 #[doc = ""]
31624 #[doc = "ID: 32"]
31625 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
31626 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
31627 #[doc = ""]
31628 #[doc = "ID: 64"]
31629 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
31630 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
31631 #[doc = ""]
31632 #[doc = "ID: 89"]
31633 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
31634 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
31635 #[doc = ""]
31636 #[doc = "ID: 268"]
31637 LOGGING_ACK(LOGGING_ACK_DATA),
31638 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
31639 #[doc = ""]
31640 #[doc = "ID: 266"]
31641 LOGGING_DATA(LOGGING_DATA_DATA),
31642 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
31643 #[doc = ""]
31644 #[doc = "ID: 267"]
31645 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
31646 #[doc = "Reply to LOG_REQUEST_DATA."]
31647 #[doc = ""]
31648 #[doc = "ID: 120"]
31649 LOG_DATA(LOG_DATA_DATA),
31650 #[doc = "Reply to LOG_REQUEST_LIST."]
31651 #[doc = ""]
31652 #[doc = "ID: 118"]
31653 LOG_ENTRY(LOG_ENTRY_DATA),
31654 #[doc = "Erase all logs."]
31655 #[doc = ""]
31656 #[doc = "ID: 121"]
31657 LOG_ERASE(LOG_ERASE_DATA),
31658 #[doc = "Request a chunk of a log."]
31659 #[doc = ""]
31660 #[doc = "ID: 119"]
31661 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
31662 #[doc = "Stop log transfer and resume normal logging."]
31663 #[doc = ""]
31664 #[doc = "ID: 122"]
31665 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
31666 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
31667 #[doc = ""]
31668 #[doc = "ID: 117"]
31669 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
31670 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
31671 #[doc = ""]
31672 #[doc = "ID: 192"]
31673 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
31674 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
31675 #[doc = ""]
31676 #[doc = "ID: 69"]
31677 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
31678 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
31679 #[doc = ""]
31680 #[doc = "ID: 81"]
31681 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
31682 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
31683 #[doc = ""]
31684 #[doc = "ID: 249"]
31685 MEMORY_VECT(MEMORY_VECT_DATA),
31686 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
31687 #[doc = ""]
31688 #[doc = "ID: 244"]
31689 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
31690 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
31691 #[doc = ""]
31692 #[doc = "ID: 47"]
31693 MISSION_ACK(MISSION_ACK_DATA),
31694 #[doc = "Delete all mission items at once."]
31695 #[doc = ""]
31696 #[doc = "ID: 45"]
31697 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
31698 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
31699 #[doc = ""]
31700 #[doc = "ID: 44"]
31701 MISSION_COUNT(MISSION_COUNT_DATA),
31702 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
31703 #[doc = ""]
31704 #[doc = "ID: 42"]
31705 MISSION_CURRENT(MISSION_CURRENT_DATA),
31706 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
31707 #[doc = ""]
31708 #[doc = "ID: 39"]
31709 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
31710 MISSION_ITEM(MISSION_ITEM_DATA),
31711 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
31712 #[doc = ""]
31713 #[doc = "ID: 73"]
31714 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
31715 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
31716 #[doc = ""]
31717 #[doc = "ID: 46"]
31718 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
31719 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
31720 #[doc = ""]
31721 #[doc = "ID: 40"]
31722 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
31723 MISSION_REQUEST(MISSION_REQUEST_DATA),
31724 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
31725 #[doc = ""]
31726 #[doc = "ID: 51"]
31727 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
31728 #[doc = "Request the overall list of mission items from the system/component."]
31729 #[doc = ""]
31730 #[doc = "ID: 43"]
31731 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
31732 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
31733 #[doc = ""]
31734 #[doc = "ID: 37"]
31735 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
31736 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
31737 #[doc = ""]
31738 #[doc = "ID: 41"]
31739 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
31740 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
31741 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
31742 #[doc = ""]
31743 #[doc = "ID: 38"]
31744 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
31745 #[doc = "Orientation of a mount."]
31746 #[doc = ""]
31747 #[doc = "ID: 265"]
31748 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
31749 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
31750 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
31751 #[doc = ""]
31752 #[doc = "ID: 251"]
31753 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
31754 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
31755 #[doc = ""]
31756 #[doc = "ID: 252"]
31757 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
31758 #[doc = "The state of the navigation and position controller."]
31759 #[doc = ""]
31760 #[doc = "ID: 62"]
31761 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
31762 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
31763 #[doc = ""]
31764 #[doc = "ID: 330"]
31765 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
31766 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
31767 #[doc = ""]
31768 #[doc = "ID: 331"]
31769 ODOMETRY(ODOMETRY_DATA),
31770 #[doc = "Hardware status sent by an onboard computer."]
31771 #[doc = ""]
31772 #[doc = "ID: 390"]
31773 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
31774 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
31775 #[doc = ""]
31776 #[doc = "ID: 12918"]
31777 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
31778 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
31779 #[doc = ""]
31780 #[doc = "ID: 12902"]
31781 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
31782 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
31783 #[doc = ""]
31784 #[doc = "ID: 12900"]
31785 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
31786 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
31787 #[doc = ""]
31788 #[doc = "ID: 12901"]
31789 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
31790 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
31791 #[doc = ""]
31792 #[doc = "ID: 12915"]
31793 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
31794 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
31795 #[doc = ""]
31796 #[doc = "ID: 12905"]
31797 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
31798 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
31799 #[doc = ""]
31800 #[doc = "ID: 12903"]
31801 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
31802 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
31803 #[doc = ""]
31804 #[doc = "ID: 12904"]
31805 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
31806 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
31807 #[doc = ""]
31808 #[doc = "ID: 12919"]
31809 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
31810 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
31811 #[doc = ""]
31812 #[doc = "ID: 100"]
31813 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
31814 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
31815 #[doc = ""]
31816 #[doc = "ID: 106"]
31817 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
31818 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
31819 #[doc = ""]
31820 #[doc = "ID: 360"]
31821 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
31822 #[doc = "Response from a PARAM_EXT_SET message."]
31823 #[doc = ""]
31824 #[doc = "ID: 324"]
31825 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
31826 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
31827 #[doc = ""]
31828 #[doc = "ID: 321"]
31829 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
31830 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
31831 #[doc = ""]
31832 #[doc = "ID: 320"]
31833 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
31834 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
31835 #[doc = ""]
31836 #[doc = "ID: 323"]
31837 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
31838 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
31839 #[doc = ""]
31840 #[doc = "ID: 322"]
31841 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
31842 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
31843 #[doc = ""]
31844 #[doc = "ID: 50"]
31845 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
31846 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
31847 #[doc = ""]
31848 #[doc = "ID: 21"]
31849 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
31850 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
31851 #[doc = ""]
31852 #[doc = "ID: 20"]
31853 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
31854 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
31855 #[doc = ""]
31856 #[doc = "ID: 23"]
31857 PARAM_SET(PARAM_SET_DATA),
31858 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
31859 #[doc = ""]
31860 #[doc = "ID: 22"]
31861 PARAM_VALUE(PARAM_VALUE_DATA),
31862 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
31863 #[doc = ""]
31864 #[doc = "ID: 4"]
31865 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
31866 PING(PING_DATA),
31867 #[doc = "Control vehicle tone generation (buzzer)."]
31868 #[doc = ""]
31869 #[doc = "ID: 258"]
31870 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
31871 PLAY_TUNE(PLAY_TUNE_DATA),
31872 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
31873 #[doc = ""]
31874 #[doc = "ID: 400"]
31875 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
31876 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
31877 #[doc = ""]
31878 #[doc = "ID: 87"]
31879 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
31880 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
31881 #[doc = ""]
31882 #[doc = "ID: 85"]
31883 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
31884 #[doc = "Power supply status."]
31885 #[doc = ""]
31886 #[doc = "ID: 125"]
31887 POWER_STATUS(POWER_STATUS_DATA),
31888 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
31889 #[doc = ""]
31890 #[doc = "ID: 300"]
31891 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
31892 #[doc = "Status generated by radio and injected into MAVLink stream."]
31893 #[doc = ""]
31894 #[doc = "ID: 109"]
31895 RADIO_STATUS(RADIO_STATUS_DATA),
31896 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
31897 #[doc = ""]
31898 #[doc = "ID: 27"]
31899 RAW_IMU(RAW_IMU_DATA),
31900 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
31901 #[doc = ""]
31902 #[doc = "ID: 28"]
31903 RAW_PRESSURE(RAW_PRESSURE_DATA),
31904 #[doc = "RPM sensor data message."]
31905 #[doc = ""]
31906 #[doc = "ID: 339"]
31907 RAW_RPM(RAW_RPM_DATA),
31908 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
31909 #[doc = ""]
31910 #[doc = "ID: 65"]
31911 RC_CHANNELS(RC_CHANNELS_DATA),
31912 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
31913 #[doc = ""]
31914 #[doc = "ID: 70"]
31915 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
31916 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
31917 #[doc = ""]
31918 #[doc = "ID: 35"]
31919 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
31920 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
31921 #[doc = ""]
31922 #[doc = "ID: 34"]
31923 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
31924 #[doc = "Request a data stream."]
31925 #[doc = ""]
31926 #[doc = "ID: 66"]
31927 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
31928 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
31929 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
31930 #[doc = ""]
31931 #[doc = "ID: 412"]
31932 REQUEST_EVENT(REQUEST_EVENT_DATA),
31933 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
31934 #[doc = ""]
31935 #[doc = "ID: 142"]
31936 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
31937 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
31938 #[doc = ""]
31939 #[doc = "ID: 413"]
31940 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
31941 #[doc = "Read out the safety zone the MAV currently assumes."]
31942 #[doc = ""]
31943 #[doc = "ID: 55"]
31944 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
31945 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
31946 #[doc = ""]
31947 #[doc = "ID: 54"]
31948 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
31949 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
31950 #[doc = ""]
31951 #[doc = "ID: 26"]
31952 SCALED_IMU(SCALED_IMU_DATA),
31953 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
31954 #[doc = ""]
31955 #[doc = "ID: 116"]
31956 SCALED_IMU2(SCALED_IMU2_DATA),
31957 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
31958 #[doc = ""]
31959 #[doc = "ID: 129"]
31960 SCALED_IMU3(SCALED_IMU3_DATA),
31961 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
31962 #[doc = ""]
31963 #[doc = "ID: 29"]
31964 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
31965 #[doc = "Barometer readings for 2nd barometer."]
31966 #[doc = ""]
31967 #[doc = "ID: 137"]
31968 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
31969 #[doc = "Barometer readings for 3rd barometer."]
31970 #[doc = ""]
31971 #[doc = "ID: 143"]
31972 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
31973 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
31974 #[doc = ""]
31975 #[doc = "ID: 126"]
31976 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
31977 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
31978 #[doc = ""]
31979 #[doc = "ID: 36"]
31980 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
31981 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
31982 #[doc = ""]
31983 #[doc = "ID: 256"]
31984 SETUP_SIGNING(SETUP_SIGNING_DATA),
31985 #[doc = "Set the vehicle attitude and body angular rates."]
31986 #[doc = ""]
31987 #[doc = "ID: 139"]
31988 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
31989 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
31990 #[doc = ""]
31991 #[doc = "ID: 82"]
31992 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
31993 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
31994 #[doc = ""]
31995 #[doc = "ID: 48"]
31996 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
31997 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
31998 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
31999 #[doc = ""]
32000 #[doc = "ID: 243"]
32001 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
32002 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
32003 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
32004 #[doc = ""]
32005 #[doc = "ID: 11"]
32006 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
32007 SET_MODE(SET_MODE_DATA),
32008 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
32009 #[doc = ""]
32010 #[doc = "ID: 86"]
32011 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
32012 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
32013 #[doc = ""]
32014 #[doc = "ID: 84"]
32015 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
32016 #[doc = "Status of simulation environment, if used."]
32017 #[doc = ""]
32018 #[doc = "ID: 108"]
32019 SIM_STATE(SIM_STATE_DATA),
32020 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
32021 #[doc = ""]
32022 #[doc = "ID: 370"]
32023 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
32024 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
32025 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
32026 #[doc = ""]
32027 #[doc = "ID: 253"]
32028 STATUSTEXT(STATUSTEXT_DATA),
32029 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
32030 #[doc = ""]
32031 #[doc = "ID: 261"]
32032 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
32033 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
32034 #[doc = ""]
32035 #[doc = "ID: 401"]
32036 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
32037 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
32038 #[doc = ""]
32039 #[doc = "ID: 2"]
32040 SYSTEM_TIME(SYSTEM_TIME_DATA),
32041 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
32042 #[doc = ""]
32043 #[doc = "ID: 1"]
32044 SYS_STATUS(SYS_STATUS_DATA),
32045 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
32046 #[doc = ""]
32047 #[doc = "ID: 135"]
32048 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
32049 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32050 #[doc = ""]
32051 #[doc = "ID: 134"]
32052 TERRAIN_DATA(TERRAIN_DATA_DATA),
32053 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32054 #[doc = ""]
32055 #[doc = "ID: 136"]
32056 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
32057 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32058 #[doc = ""]
32059 #[doc = "ID: 133"]
32060 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
32061 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
32062 #[doc = ""]
32063 #[doc = "ID: 111"]
32064 TIMESYNC(TIMESYNC_DATA),
32065 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
32066 #[doc = ""]
32067 #[doc = "ID: 380"]
32068 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
32069 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
32070 #[doc = ""]
32071 #[doc = "ID: 333"]
32072 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
32073 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
32074 #[doc = ""]
32075 #[doc = "ID: 332"]
32076 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
32077 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
32078 #[doc = ""]
32079 #[doc = "ID: 385"]
32080 TUNNEL(TUNNEL_DATA),
32081 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
32082 #[doc = ""]
32083 #[doc = "ID: 311"]
32084 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
32085 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
32086 #[doc = ""]
32087 #[doc = "ID: 310"]
32088 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
32089 #[doc = "The global position resulting from GPS and sensor fusion."]
32090 #[doc = ""]
32091 #[doc = "ID: 340"]
32092 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
32093 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
32094 #[doc = ""]
32095 #[doc = "ID: 248"]
32096 V2_EXTENSION(V2_EXTENSION_DATA),
32097 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
32098 #[doc = ""]
32099 #[doc = "ID: 74"]
32100 VFR_HUD(VFR_HUD_DATA),
32101 #[doc = "Vibration levels and accelerometer clipping."]
32102 #[doc = ""]
32103 #[doc = "ID: 241"]
32104 VIBRATION(VIBRATION_DATA),
32105 #[doc = "Global position estimate from a Vicon motion system source."]
32106 #[doc = ""]
32107 #[doc = "ID: 104"]
32108 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
32109 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
32110 #[doc = ""]
32111 #[doc = "ID: 269"]
32112 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
32113 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
32114 #[doc = ""]
32115 #[doc = "ID: 270"]
32116 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
32117 #[doc = "Local position/attitude estimate from a vision source."]
32118 #[doc = ""]
32119 #[doc = "ID: 102"]
32120 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
32121 #[doc = "Speed estimate from a vision source."]
32122 #[doc = ""]
32123 #[doc = "ID: 103"]
32124 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
32125 #[doc = "Cumulative distance traveled for each reported wheel."]
32126 #[doc = ""]
32127 #[doc = "ID: 9000"]
32128 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
32129 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32130 #[doc = ""]
32131 #[doc = "ID: 299"]
32132 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
32133 #[doc = "Winch status."]
32134 #[doc = ""]
32135 #[doc = "ID: 9005"]
32136 WINCH_STATUS(WINCH_STATUS_DATA),
32137 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
32138 #[doc = ""]
32139 #[doc = "ID: 231"]
32140 WIND_COV(WIND_COV_DATA),
32141}
32142impl MavMessage {
32143 pub const fn all_ids() -> &'static [u32] {
32144 &[
32145 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
32146 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
32147 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
32148 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
32149 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
32150 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
32151 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
32152 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
32153 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
32154 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
32155 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
32156 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
32157 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
32158 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
32159 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
32160 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32, 330u32,
32161 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 360u32, 370u32,
32162 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32, 390u32, 395u32,
32163 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32, 436u32, 437u32,
32164 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32,
32165 12915u32, 12918u32, 12919u32, 12920u32,
32166 ]
32167 }
32168}
32169impl Message for MavMessage {
32170 fn parse(
32171 version: MavlinkVersion,
32172 id: u32,
32173 payload: &[u8],
32174 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32175 match id {
32176 ACTUATOR_CONTROL_TARGET_DATA::ID => {
32177 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
32178 .map(Self::ACTUATOR_CONTROL_TARGET)
32179 }
32180 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
32181 .map(Self::ACTUATOR_OUTPUT_STATUS),
32182 ADSB_VEHICLE_DATA::ID => {
32183 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
32184 }
32185 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
32186 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
32187 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
32188 ATTITUDE_QUATERNION_DATA::ID => {
32189 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
32190 }
32191 ATTITUDE_QUATERNION_COV_DATA::ID => {
32192 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
32193 .map(Self::ATTITUDE_QUATERNION_COV)
32194 }
32195 ATTITUDE_TARGET_DATA::ID => {
32196 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
32197 }
32198 ATT_POS_MOCAP_DATA::ID => {
32199 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
32200 }
32201 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
32202 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
32203 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
32204 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
32205 }
32206 AUTOPILOT_VERSION_DATA::ID => {
32207 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
32208 }
32209 AVAILABLE_MODES_DATA::ID => {
32210 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
32211 }
32212 AVAILABLE_MODES_MONITOR_DATA::ID => {
32213 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
32214 .map(Self::AVAILABLE_MODES_MONITOR)
32215 }
32216 BATTERY_INFO_DATA::ID => {
32217 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
32218 }
32219 BATTERY_STATUS_DATA::ID => {
32220 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
32221 }
32222 BUTTON_CHANGE_DATA::ID => {
32223 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
32224 }
32225 CAMERA_CAPTURE_STATUS_DATA::ID => {
32226 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
32227 }
32228 CAMERA_FOV_STATUS_DATA::ID => {
32229 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
32230 }
32231 CAMERA_IMAGE_CAPTURED_DATA::ID => {
32232 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
32233 }
32234 CAMERA_INFORMATION_DATA::ID => {
32235 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
32236 }
32237 CAMERA_SETTINGS_DATA::ID => {
32238 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
32239 }
32240 CAMERA_THERMAL_RANGE_DATA::ID => {
32241 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
32242 }
32243 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
32244 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
32245 .map(Self::CAMERA_TRACKING_GEO_STATUS)
32246 }
32247 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
32248 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
32249 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
32250 }
32251 CAMERA_TRIGGER_DATA::ID => {
32252 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
32253 }
32254 CANFD_FRAME_DATA::ID => {
32255 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
32256 }
32257 CAN_FILTER_MODIFY_DATA::ID => {
32258 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
32259 }
32260 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
32261 CELLULAR_CONFIG_DATA::ID => {
32262 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
32263 }
32264 CELLULAR_STATUS_DATA::ID => {
32265 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
32266 }
32267 CHANGE_OPERATOR_CONTROL_DATA::ID => {
32268 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
32269 .map(Self::CHANGE_OPERATOR_CONTROL)
32270 }
32271 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
32272 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
32273 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
32274 }
32275 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
32276 COMMAND_ACK_DATA::ID => {
32277 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
32278 }
32279 COMMAND_CANCEL_DATA::ID => {
32280 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
32281 }
32282 COMMAND_INT_DATA::ID => {
32283 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
32284 }
32285 COMMAND_LONG_DATA::ID => {
32286 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
32287 }
32288 COMPONENT_INFORMATION_DATA::ID => {
32289 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
32290 }
32291 COMPONENT_INFORMATION_BASIC_DATA::ID => {
32292 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
32293 .map(Self::COMPONENT_INFORMATION_BASIC)
32294 }
32295 COMPONENT_METADATA_DATA::ID => {
32296 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
32297 }
32298 CONTROL_SYSTEM_STATE_DATA::ID => {
32299 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
32300 }
32301 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
32302 .map(Self::CURRENT_EVENT_SEQUENCE),
32303 CURRENT_MODE_DATA::ID => {
32304 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
32305 }
32306 DATA_STREAM_DATA::ID => {
32307 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
32308 }
32309 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
32310 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
32311 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
32312 }
32313 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
32314 DEBUG_FLOAT_ARRAY_DATA::ID => {
32315 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
32316 }
32317 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
32318 DISTANCE_SENSOR_DATA::ID => {
32319 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
32320 }
32321 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
32322 ENCAPSULATED_DATA_DATA::ID => {
32323 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
32324 }
32325 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
32326 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
32327 ESTIMATOR_STATUS_DATA::ID => {
32328 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
32329 }
32330 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
32331 EXTENDED_SYS_STATE_DATA::ID => {
32332 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
32333 }
32334 FENCE_STATUS_DATA::ID => {
32335 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
32336 }
32337 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
32338 .map(Self::FILE_TRANSFER_PROTOCOL),
32339 FLIGHT_INFORMATION_DATA::ID => {
32340 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
32341 }
32342 FOLLOW_TARGET_DATA::ID => {
32343 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
32344 }
32345 FUEL_STATUS_DATA::ID => {
32346 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
32347 }
32348 GENERATOR_STATUS_DATA::ID => {
32349 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
32350 }
32351 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
32352 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
32353 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
32354 }
32355 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
32356 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
32357 .map(Self::GIMBAL_DEVICE_INFORMATION)
32358 }
32359 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
32360 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
32361 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
32362 }
32363 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
32364 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
32365 .map(Self::GIMBAL_MANAGER_INFORMATION)
32366 }
32367 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
32368 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
32369 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
32370 }
32371 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
32372 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
32373 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
32374 }
32375 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
32376 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
32377 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
32378 }
32379 GIMBAL_MANAGER_STATUS_DATA::ID => {
32380 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
32381 }
32382 GLOBAL_POSITION_INT_DATA::ID => {
32383 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
32384 }
32385 GLOBAL_POSITION_INT_COV_DATA::ID => {
32386 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
32387 .map(Self::GLOBAL_POSITION_INT_COV)
32388 }
32389 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
32390 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
32391 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
32392 }
32393 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
32394 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
32395 GPS_GLOBAL_ORIGIN_DATA::ID => {
32396 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
32397 }
32398 GPS_INJECT_DATA_DATA::ID => {
32399 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
32400 }
32401 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
32402 GPS_RAW_INT_DATA::ID => {
32403 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
32404 }
32405 GPS_RTCM_DATA_DATA::ID => {
32406 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
32407 }
32408 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
32409 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
32410 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
32411 HIGHRES_IMU_DATA::ID => {
32412 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
32413 }
32414 HIGH_LATENCY_DATA::ID => {
32415 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
32416 }
32417 HIGH_LATENCY2_DATA::ID => {
32418 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
32419 }
32420 HIL_ACTUATOR_CONTROLS_DATA::ID => {
32421 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
32422 }
32423 HIL_CONTROLS_DATA::ID => {
32424 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
32425 }
32426 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
32427 HIL_OPTICAL_FLOW_DATA::ID => {
32428 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
32429 }
32430 HIL_RC_INPUTS_RAW_DATA::ID => {
32431 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
32432 }
32433 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
32434 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
32435 HIL_STATE_QUATERNION_DATA::ID => {
32436 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
32437 }
32438 HOME_POSITION_DATA::ID => {
32439 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
32440 }
32441 HYGROMETER_SENSOR_DATA::ID => {
32442 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
32443 }
32444 ILLUMINATOR_STATUS_DATA::ID => {
32445 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
32446 }
32447 ISBD_LINK_STATUS_DATA::ID => {
32448 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
32449 }
32450 LANDING_TARGET_DATA::ID => {
32451 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
32452 }
32453 LINK_NODE_STATUS_DATA::ID => {
32454 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
32455 }
32456 LOCAL_POSITION_NED_DATA::ID => {
32457 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
32458 }
32459 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
32460 .map(Self::LOCAL_POSITION_NED_COV),
32461 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
32462 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
32463 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
32464 }
32465 LOGGING_ACK_DATA::ID => {
32466 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
32467 }
32468 LOGGING_DATA_DATA::ID => {
32469 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
32470 }
32471 LOGGING_DATA_ACKED_DATA::ID => {
32472 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
32473 }
32474 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
32475 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
32476 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
32477 LOG_REQUEST_DATA_DATA::ID => {
32478 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
32479 }
32480 LOG_REQUEST_END_DATA::ID => {
32481 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
32482 }
32483 LOG_REQUEST_LIST_DATA::ID => {
32484 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
32485 }
32486 MAG_CAL_REPORT_DATA::ID => {
32487 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
32488 }
32489 MANUAL_CONTROL_DATA::ID => {
32490 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
32491 }
32492 MANUAL_SETPOINT_DATA::ID => {
32493 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
32494 }
32495 MEMORY_VECT_DATA::ID => {
32496 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
32497 }
32498 MESSAGE_INTERVAL_DATA::ID => {
32499 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
32500 }
32501 MISSION_ACK_DATA::ID => {
32502 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
32503 }
32504 MISSION_CLEAR_ALL_DATA::ID => {
32505 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
32506 }
32507 MISSION_COUNT_DATA::ID => {
32508 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
32509 }
32510 MISSION_CURRENT_DATA::ID => {
32511 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
32512 }
32513 MISSION_ITEM_DATA::ID => {
32514 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
32515 }
32516 MISSION_ITEM_INT_DATA::ID => {
32517 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
32518 }
32519 MISSION_ITEM_REACHED_DATA::ID => {
32520 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
32521 }
32522 MISSION_REQUEST_DATA::ID => {
32523 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
32524 }
32525 MISSION_REQUEST_INT_DATA::ID => {
32526 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
32527 }
32528 MISSION_REQUEST_LIST_DATA::ID => {
32529 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
32530 }
32531 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
32532 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
32533 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
32534 }
32535 MISSION_SET_CURRENT_DATA::ID => {
32536 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
32537 }
32538 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
32539 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
32540 .map(Self::MISSION_WRITE_PARTIAL_LIST)
32541 }
32542 MOUNT_ORIENTATION_DATA::ID => {
32543 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
32544 }
32545 NAMED_VALUE_FLOAT_DATA::ID => {
32546 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
32547 }
32548 NAMED_VALUE_INT_DATA::ID => {
32549 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
32550 }
32551 NAV_CONTROLLER_OUTPUT_DATA::ID => {
32552 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
32553 }
32554 OBSTACLE_DISTANCE_DATA::ID => {
32555 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
32556 }
32557 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
32558 ONBOARD_COMPUTER_STATUS_DATA::ID => {
32559 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
32560 .map(Self::ONBOARD_COMPUTER_STATUS)
32561 }
32562 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
32563 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
32564 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
32565 }
32566 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
32567 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
32568 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
32569 }
32570 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
32571 .map(Self::OPEN_DRONE_ID_BASIC_ID),
32572 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
32573 .map(Self::OPEN_DRONE_ID_LOCATION),
32574 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
32575 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
32576 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
32577 }
32578 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
32579 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
32580 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
32581 }
32582 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
32583 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
32584 }
32585 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
32586 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
32587 }
32588 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
32589 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
32590 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
32591 }
32592 OPTICAL_FLOW_DATA::ID => {
32593 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
32594 }
32595 OPTICAL_FLOW_RAD_DATA::ID => {
32596 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
32597 }
32598 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
32599 .map(Self::ORBIT_EXECUTION_STATUS),
32600 PARAM_EXT_ACK_DATA::ID => {
32601 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
32602 }
32603 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
32604 .map(Self::PARAM_EXT_REQUEST_LIST),
32605 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
32606 .map(Self::PARAM_EXT_REQUEST_READ),
32607 PARAM_EXT_SET_DATA::ID => {
32608 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
32609 }
32610 PARAM_EXT_VALUE_DATA::ID => {
32611 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
32612 }
32613 PARAM_MAP_RC_DATA::ID => {
32614 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
32615 }
32616 PARAM_REQUEST_LIST_DATA::ID => {
32617 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
32618 }
32619 PARAM_REQUEST_READ_DATA::ID => {
32620 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
32621 }
32622 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
32623 PARAM_VALUE_DATA::ID => {
32624 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
32625 }
32626 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
32627 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
32628 PLAY_TUNE_V2_DATA::ID => {
32629 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
32630 }
32631 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
32632 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
32633 .map(Self::POSITION_TARGET_GLOBAL_INT)
32634 }
32635 POSITION_TARGET_LOCAL_NED_DATA::ID => {
32636 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
32637 .map(Self::POSITION_TARGET_LOCAL_NED)
32638 }
32639 POWER_STATUS_DATA::ID => {
32640 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
32641 }
32642 PROTOCOL_VERSION_DATA::ID => {
32643 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
32644 }
32645 RADIO_STATUS_DATA::ID => {
32646 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
32647 }
32648 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
32649 RAW_PRESSURE_DATA::ID => {
32650 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
32651 }
32652 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
32653 RC_CHANNELS_DATA::ID => {
32654 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
32655 }
32656 RC_CHANNELS_OVERRIDE_DATA::ID => {
32657 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
32658 }
32659 RC_CHANNELS_RAW_DATA::ID => {
32660 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
32661 }
32662 RC_CHANNELS_SCALED_DATA::ID => {
32663 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
32664 }
32665 REQUEST_DATA_STREAM_DATA::ID => {
32666 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
32667 }
32668 REQUEST_EVENT_DATA::ID => {
32669 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
32670 }
32671 RESOURCE_REQUEST_DATA::ID => {
32672 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
32673 }
32674 RESPONSE_EVENT_ERROR_DATA::ID => {
32675 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
32676 }
32677 SAFETY_ALLOWED_AREA_DATA::ID => {
32678 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
32679 }
32680 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
32681 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
32682 .map(Self::SAFETY_SET_ALLOWED_AREA)
32683 }
32684 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
32685 SCALED_IMU2_DATA::ID => {
32686 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
32687 }
32688 SCALED_IMU3_DATA::ID => {
32689 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
32690 }
32691 SCALED_PRESSURE_DATA::ID => {
32692 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
32693 }
32694 SCALED_PRESSURE2_DATA::ID => {
32695 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
32696 }
32697 SCALED_PRESSURE3_DATA::ID => {
32698 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
32699 }
32700 SERIAL_CONTROL_DATA::ID => {
32701 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
32702 }
32703 SERVO_OUTPUT_RAW_DATA::ID => {
32704 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
32705 }
32706 SETUP_SIGNING_DATA::ID => {
32707 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
32708 }
32709 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
32710 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
32711 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
32712 }
32713 SET_ATTITUDE_TARGET_DATA::ID => {
32714 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
32715 }
32716 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
32717 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
32718 }
32719 SET_HOME_POSITION_DATA::ID => {
32720 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
32721 }
32722 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
32723 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
32724 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
32725 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
32726 }
32727 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
32728 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
32729 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
32730 }
32731 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
32732 SMART_BATTERY_INFO_DATA::ID => {
32733 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
32734 }
32735 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
32736 STORAGE_INFORMATION_DATA::ID => {
32737 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
32738 }
32739 SUPPORTED_TUNES_DATA::ID => {
32740 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
32741 }
32742 SYSTEM_TIME_DATA::ID => {
32743 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
32744 }
32745 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
32746 TERRAIN_CHECK_DATA::ID => {
32747 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
32748 }
32749 TERRAIN_DATA_DATA::ID => {
32750 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
32751 }
32752 TERRAIN_REPORT_DATA::ID => {
32753 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
32754 }
32755 TERRAIN_REQUEST_DATA::ID => {
32756 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
32757 }
32758 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
32759 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
32760 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
32761 .map(Self::TIME_ESTIMATE_TO_TARGET)
32762 }
32763 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
32764 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
32765 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
32766 }
32767 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
32768 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
32769 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
32770 }
32771 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
32772 UAVCAN_NODE_INFO_DATA::ID => {
32773 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
32774 }
32775 UAVCAN_NODE_STATUS_DATA::ID => {
32776 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
32777 }
32778 UTM_GLOBAL_POSITION_DATA::ID => {
32779 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
32780 }
32781 V2_EXTENSION_DATA::ID => {
32782 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
32783 }
32784 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
32785 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
32786 VICON_POSITION_ESTIMATE_DATA::ID => {
32787 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
32788 .map(Self::VICON_POSITION_ESTIMATE)
32789 }
32790 VIDEO_STREAM_INFORMATION_DATA::ID => {
32791 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
32792 .map(Self::VIDEO_STREAM_INFORMATION)
32793 }
32794 VIDEO_STREAM_STATUS_DATA::ID => {
32795 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
32796 }
32797 VISION_POSITION_ESTIMATE_DATA::ID => {
32798 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
32799 .map(Self::VISION_POSITION_ESTIMATE)
32800 }
32801 VISION_SPEED_ESTIMATE_DATA::ID => {
32802 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
32803 }
32804 WHEEL_DISTANCE_DATA::ID => {
32805 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
32806 }
32807 WIFI_CONFIG_AP_DATA::ID => {
32808 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
32809 }
32810 WINCH_STATUS_DATA::ID => {
32811 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
32812 }
32813 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
32814 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
32815 }
32816 }
32817 fn message_name(&self) -> &'static str {
32818 match self {
32819 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
32820 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
32821 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
32822 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
32823 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
32824 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
32825 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
32826 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
32827 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
32828 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
32829 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
32830 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
32831 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
32832 }
32833 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
32834 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
32835 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
32836 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
32837 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
32838 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
32839 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
32840 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
32841 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
32842 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
32843 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
32844 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
32845 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
32846 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
32847 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
32848 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
32849 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
32850 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
32851 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
32852 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
32853 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
32854 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
32855 Self::COLLISION(..) => COLLISION_DATA::NAME,
32856 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
32857 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
32858 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
32859 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
32860 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
32861 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
32862 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
32863 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
32864 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
32865 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
32866 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
32867 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
32868 Self::DEBUG(..) => DEBUG_DATA::NAME,
32869 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
32870 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
32871 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
32872 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
32873 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
32874 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
32875 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
32876 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
32877 Self::EVENT(..) => EVENT_DATA::NAME,
32878 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
32879 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
32880 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
32881 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
32882 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
32883 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
32884 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
32885 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
32886 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
32887 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
32888 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
32889 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
32890 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
32891 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
32892 }
32893 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
32894 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
32895 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
32896 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
32897 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
32898 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
32899 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
32900 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
32901 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
32902 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
32903 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
32904 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
32905 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
32906 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
32907 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
32908 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
32909 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
32910 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
32911 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
32912 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
32913 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
32914 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
32915 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
32916 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
32917 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
32918 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
32919 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
32920 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
32921 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
32922 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
32923 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
32924 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
32925 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
32926 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
32927 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
32928 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
32929 }
32930 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
32931 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
32932 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
32933 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
32934 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
32935 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
32936 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
32937 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
32938 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
32939 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
32940 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
32941 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
32942 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
32943 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
32944 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
32945 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
32946 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
32947 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
32948 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
32949 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
32950 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
32951 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
32952 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
32953 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
32954 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
32955 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
32956 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
32957 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
32958 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
32959 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
32960 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
32961 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
32962 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
32963 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
32964 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
32965 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
32966 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
32967 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
32968 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
32969 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
32970 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
32971 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
32972 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
32973 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
32974 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
32975 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
32976 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
32977 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
32978 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
32979 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
32980 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
32981 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
32982 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
32983 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
32984 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
32985 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
32986 Self::PING(..) => PING_DATA::NAME,
32987 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
32988 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
32989 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
32990 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
32991 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
32992 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
32993 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
32994 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
32995 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
32996 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
32997 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
32998 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
32999 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
33000 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
33001 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
33002 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
33003 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
33004 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
33005 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
33006 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
33007 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
33008 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
33009 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
33010 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
33011 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
33012 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
33013 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
33014 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
33015 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
33016 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
33017 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
33018 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
33019 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
33020 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
33021 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
33022 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
33023 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
33024 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
33025 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
33026 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
33027 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
33028 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
33029 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
33030 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
33031 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
33032 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
33033 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
33034 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
33035 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
33036 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
33037 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
33038 }
33039 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
33040 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
33041 }
33042 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
33043 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
33044 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
33045 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
33046 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
33047 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
33048 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
33049 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
33050 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
33051 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
33052 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
33053 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
33054 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
33055 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
33056 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
33057 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
33058 }
33059 }
33060 fn message_id(&self) -> u32 {
33061 match self {
33062 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
33063 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
33064 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
33065 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
33066 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
33067 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
33068 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
33069 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
33070 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
33071 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
33072 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
33073 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
33074 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
33075 }
33076 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
33077 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
33078 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
33079 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
33080 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
33081 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
33082 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
33083 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
33084 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
33085 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
33086 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
33087 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
33088 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
33089 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
33090 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
33091 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
33092 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
33093 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
33094 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
33095 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
33096 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
33097 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
33098 Self::COLLISION(..) => COLLISION_DATA::ID,
33099 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
33100 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
33101 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
33102 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
33103 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
33104 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
33105 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
33106 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
33107 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
33108 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
33109 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
33110 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
33111 Self::DEBUG(..) => DEBUG_DATA::ID,
33112 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
33113 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
33114 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
33115 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
33116 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
33117 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
33118 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
33119 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
33120 Self::EVENT(..) => EVENT_DATA::ID,
33121 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
33122 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
33123 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
33124 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
33125 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
33126 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
33127 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
33128 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
33129 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
33130 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
33131 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
33132 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
33133 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
33134 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
33135 }
33136 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
33137 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
33138 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
33139 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
33140 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
33141 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
33142 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
33143 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
33144 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
33145 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
33146 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
33147 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
33148 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
33149 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
33150 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
33151 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
33152 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
33153 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
33154 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
33155 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
33156 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
33157 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
33158 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
33159 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
33160 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
33161 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
33162 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
33163 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
33164 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
33165 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
33166 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
33167 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
33168 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
33169 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
33170 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
33171 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
33172 }
33173 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
33174 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
33175 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
33176 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
33177 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
33178 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
33179 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
33180 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
33181 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
33182 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
33183 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
33184 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
33185 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
33186 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
33187 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
33188 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
33189 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
33190 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
33191 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
33192 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
33193 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
33194 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
33195 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
33196 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
33197 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
33198 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
33199 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
33200 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
33201 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
33202 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
33203 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
33204 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
33205 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
33206 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
33207 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
33208 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
33209 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
33210 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
33211 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
33212 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
33213 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
33214 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
33215 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
33216 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
33217 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
33218 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
33219 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
33220 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
33221 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
33222 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
33223 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
33224 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
33225 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
33226 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
33227 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
33228 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
33229 Self::PING(..) => PING_DATA::ID,
33230 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
33231 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
33232 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
33233 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
33234 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
33235 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
33236 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
33237 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
33238 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
33239 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
33240 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
33241 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
33242 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
33243 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
33244 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
33245 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
33246 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
33247 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
33248 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
33249 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
33250 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
33251 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
33252 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
33253 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
33254 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
33255 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
33256 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
33257 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
33258 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
33259 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
33260 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
33261 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
33262 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
33263 Self::SET_MODE(..) => SET_MODE_DATA::ID,
33264 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
33265 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
33266 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
33267 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
33268 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
33269 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
33270 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
33271 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
33272 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
33273 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
33274 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
33275 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
33276 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
33277 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
33278 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
33279 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
33280 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
33281 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
33282 }
33283 Self::TUNNEL(..) => TUNNEL_DATA::ID,
33284 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
33285 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
33286 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
33287 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
33288 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
33289 Self::VIBRATION(..) => VIBRATION_DATA::ID,
33290 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
33291 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
33292 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
33293 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
33294 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
33295 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
33296 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
33297 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
33298 Self::WIND_COV(..) => WIND_COV_DATA::ID,
33299 }
33300 }
33301 fn message_id_from_name(name: &str) -> Option<u32> {
33302 match name {
33303 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
33304 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
33305 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
33306 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
33307 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
33308 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
33309 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
33310 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
33311 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
33312 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
33313 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
33314 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
33315 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
33316 }
33317 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
33318 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
33319 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
33320 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
33321 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
33322 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
33323 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
33324 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
33325 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
33326 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
33327 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
33328 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
33329 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
33330 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
33331 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
33332 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
33333 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
33334 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
33335 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
33336 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
33337 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
33338 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
33339 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
33340 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
33341 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
33342 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
33343 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
33344 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
33345 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
33346 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
33347 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
33348 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
33349 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
33350 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
33351 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
33352 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
33353 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
33354 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
33355 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
33356 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
33357 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
33358 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
33359 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
33360 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
33361 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
33362 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
33363 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
33364 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
33365 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
33366 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
33367 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
33368 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
33369 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
33370 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
33371 }
33372 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
33373 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
33374 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
33375 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
33376 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
33377 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
33378 }
33379 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
33380 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
33381 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
33382 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
33383 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
33384 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
33385 }
33386 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
33387 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
33388 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
33389 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
33390 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
33391 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
33392 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
33393 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
33394 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
33395 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
33396 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
33397 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
33398 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
33399 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
33400 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
33401 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
33402 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
33403 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
33404 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
33405 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
33406 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
33407 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
33408 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
33409 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
33410 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
33411 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
33412 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
33413 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
33414 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
33415 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
33416 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
33417 }
33418 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
33419 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
33420 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
33421 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
33422 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
33423 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
33424 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
33425 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
33426 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
33427 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
33428 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
33429 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
33430 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
33431 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
33432 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
33433 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
33434 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
33435 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
33436 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
33437 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
33438 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
33439 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
33440 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
33441 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
33442 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
33443 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
33444 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
33445 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
33446 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
33447 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
33448 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
33449 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
33450 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
33451 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
33452 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
33453 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
33454 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
33455 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
33456 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
33457 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
33458 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
33459 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
33460 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
33461 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
33462 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
33463 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
33464 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
33465 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
33466 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
33467 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
33468 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
33469 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
33470 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
33471 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
33472 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
33473 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
33474 PING_DATA::NAME => Some(PING_DATA::ID),
33475 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
33476 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
33477 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
33478 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
33479 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
33480 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
33481 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
33482 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
33483 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
33484 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
33485 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
33486 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
33487 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
33488 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
33489 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
33490 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
33491 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
33492 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
33493 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
33494 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
33495 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
33496 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
33497 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
33498 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
33499 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
33500 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
33501 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
33502 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
33503 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
33504 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
33505 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
33506 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
33507 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
33508 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
33509 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
33510 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
33511 }
33512 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
33513 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
33514 }
33515 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
33516 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
33517 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
33518 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
33519 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
33520 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
33521 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
33522 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
33523 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
33524 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
33525 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
33526 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
33527 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
33528 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
33529 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
33530 }
33531 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
33532 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
33533 }
33534 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
33535 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
33536 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
33537 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
33538 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
33539 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
33540 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
33541 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
33542 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
33543 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
33544 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
33545 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
33546 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
33547 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
33548 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
33549 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
33550 _ => None,
33551 }
33552 }
33553 fn default_message_from_id(id: u32) -> Option<Self> {
33554 match id {
33555 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
33556 ACTUATOR_CONTROL_TARGET_DATA::default(),
33557 )),
33558 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
33559 ACTUATOR_OUTPUT_STATUS_DATA::default(),
33560 )),
33561 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
33562 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
33563 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
33564 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
33565 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
33566 ATTITUDE_QUATERNION_DATA::default(),
33567 )),
33568 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
33569 ATTITUDE_QUATERNION_COV_DATA::default(),
33570 )),
33571 ATTITUDE_TARGET_DATA::ID => {
33572 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
33573 }
33574 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
33575 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
33576 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33577 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
33578 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
33579 ))
33580 }
33581 AUTOPILOT_VERSION_DATA::ID => {
33582 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
33583 }
33584 AVAILABLE_MODES_DATA::ID => {
33585 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
33586 }
33587 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
33588 AVAILABLE_MODES_MONITOR_DATA::default(),
33589 )),
33590 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
33591 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
33592 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
33593 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
33594 CAMERA_CAPTURE_STATUS_DATA::default(),
33595 )),
33596 CAMERA_FOV_STATUS_DATA::ID => {
33597 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
33598 }
33599 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
33600 CAMERA_IMAGE_CAPTURED_DATA::default(),
33601 )),
33602 CAMERA_INFORMATION_DATA::ID => {
33603 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
33604 }
33605 CAMERA_SETTINGS_DATA::ID => {
33606 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
33607 }
33608 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
33609 CAMERA_THERMAL_RANGE_DATA::default(),
33610 )),
33611 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
33612 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
33613 )),
33614 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
33615 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
33616 )),
33617 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
33618 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
33619 CAN_FILTER_MODIFY_DATA::ID => {
33620 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
33621 }
33622 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
33623 CELLULAR_CONFIG_DATA::ID => {
33624 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
33625 }
33626 CELLULAR_STATUS_DATA::ID => {
33627 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
33628 }
33629 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
33630 CHANGE_OPERATOR_CONTROL_DATA::default(),
33631 )),
33632 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
33633 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
33634 )),
33635 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
33636 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
33637 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
33638 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
33639 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
33640 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
33641 COMPONENT_INFORMATION_DATA::default(),
33642 )),
33643 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
33644 COMPONENT_INFORMATION_BASIC_DATA::default(),
33645 )),
33646 COMPONENT_METADATA_DATA::ID => {
33647 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
33648 }
33649 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
33650 CONTROL_SYSTEM_STATE_DATA::default(),
33651 )),
33652 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
33653 CURRENT_EVENT_SEQUENCE_DATA::default(),
33654 )),
33655 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
33656 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
33657 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
33658 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
33659 )),
33660 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
33661 DEBUG_FLOAT_ARRAY_DATA::ID => {
33662 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
33663 }
33664 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
33665 DISTANCE_SENSOR_DATA::ID => {
33666 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
33667 }
33668 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
33669 ENCAPSULATED_DATA_DATA::ID => {
33670 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
33671 }
33672 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
33673 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
33674 ESTIMATOR_STATUS_DATA::ID => {
33675 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
33676 }
33677 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
33678 EXTENDED_SYS_STATE_DATA::ID => {
33679 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
33680 }
33681 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
33682 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
33683 FILE_TRANSFER_PROTOCOL_DATA::default(),
33684 )),
33685 FLIGHT_INFORMATION_DATA::ID => {
33686 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
33687 }
33688 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
33689 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
33690 GENERATOR_STATUS_DATA::ID => {
33691 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
33692 }
33693 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
33694 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
33695 )),
33696 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
33697 GIMBAL_DEVICE_INFORMATION_DATA::default(),
33698 )),
33699 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
33700 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
33701 )),
33702 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
33703 GIMBAL_MANAGER_INFORMATION_DATA::default(),
33704 )),
33705 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
33706 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
33707 )),
33708 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33709 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
33710 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
33711 ))
33712 }
33713 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
33714 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
33715 )),
33716 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
33717 GIMBAL_MANAGER_STATUS_DATA::default(),
33718 )),
33719 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
33720 GLOBAL_POSITION_INT_DATA::default(),
33721 )),
33722 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
33723 GLOBAL_POSITION_INT_COV_DATA::default(),
33724 )),
33725 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33726 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
33727 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
33728 ))
33729 }
33730 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
33731 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
33732 GPS_GLOBAL_ORIGIN_DATA::ID => {
33733 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
33734 }
33735 GPS_INJECT_DATA_DATA::ID => {
33736 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
33737 }
33738 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
33739 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
33740 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
33741 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
33742 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
33743 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
33744 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
33745 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
33746 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
33747 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
33748 HIL_ACTUATOR_CONTROLS_DATA::default(),
33749 )),
33750 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
33751 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
33752 HIL_OPTICAL_FLOW_DATA::ID => {
33753 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
33754 }
33755 HIL_RC_INPUTS_RAW_DATA::ID => {
33756 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
33757 }
33758 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
33759 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
33760 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
33761 HIL_STATE_QUATERNION_DATA::default(),
33762 )),
33763 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
33764 HYGROMETER_SENSOR_DATA::ID => {
33765 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
33766 }
33767 ILLUMINATOR_STATUS_DATA::ID => {
33768 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
33769 }
33770 ISBD_LINK_STATUS_DATA::ID => {
33771 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
33772 }
33773 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
33774 LINK_NODE_STATUS_DATA::ID => {
33775 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
33776 }
33777 LOCAL_POSITION_NED_DATA::ID => {
33778 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
33779 }
33780 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
33781 LOCAL_POSITION_NED_COV_DATA::default(),
33782 )),
33783 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33784 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
33785 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
33786 ))
33787 }
33788 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
33789 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
33790 LOGGING_DATA_ACKED_DATA::ID => {
33791 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
33792 }
33793 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
33794 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
33795 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
33796 LOG_REQUEST_DATA_DATA::ID => {
33797 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
33798 }
33799 LOG_REQUEST_END_DATA::ID => {
33800 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
33801 }
33802 LOG_REQUEST_LIST_DATA::ID => {
33803 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
33804 }
33805 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
33806 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
33807 MANUAL_SETPOINT_DATA::ID => {
33808 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
33809 }
33810 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
33811 MESSAGE_INTERVAL_DATA::ID => {
33812 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
33813 }
33814 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
33815 MISSION_CLEAR_ALL_DATA::ID => {
33816 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
33817 }
33818 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
33819 MISSION_CURRENT_DATA::ID => {
33820 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
33821 }
33822 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
33823 MISSION_ITEM_INT_DATA::ID => {
33824 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
33825 }
33826 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
33827 MISSION_ITEM_REACHED_DATA::default(),
33828 )),
33829 MISSION_REQUEST_DATA::ID => {
33830 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
33831 }
33832 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
33833 MISSION_REQUEST_INT_DATA::default(),
33834 )),
33835 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
33836 MISSION_REQUEST_LIST_DATA::default(),
33837 )),
33838 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
33839 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
33840 )),
33841 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
33842 MISSION_SET_CURRENT_DATA::default(),
33843 )),
33844 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
33845 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
33846 )),
33847 MOUNT_ORIENTATION_DATA::ID => {
33848 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
33849 }
33850 NAMED_VALUE_FLOAT_DATA::ID => {
33851 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
33852 }
33853 NAMED_VALUE_INT_DATA::ID => {
33854 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
33855 }
33856 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
33857 NAV_CONTROLLER_OUTPUT_DATA::default(),
33858 )),
33859 OBSTACLE_DISTANCE_DATA::ID => {
33860 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
33861 }
33862 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
33863 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
33864 ONBOARD_COMPUTER_STATUS_DATA::default(),
33865 )),
33866 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
33867 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
33868 )),
33869 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
33870 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
33871 )),
33872 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
33873 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
33874 )),
33875 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
33876 OPEN_DRONE_ID_LOCATION_DATA::default(),
33877 )),
33878 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
33879 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
33880 )),
33881 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
33882 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
33883 )),
33884 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
33885 OPEN_DRONE_ID_SELF_ID_DATA::default(),
33886 )),
33887 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
33888 OPEN_DRONE_ID_SYSTEM_DATA::default(),
33889 )),
33890 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
33891 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
33892 )),
33893 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
33894 OPTICAL_FLOW_RAD_DATA::ID => {
33895 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
33896 }
33897 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
33898 ORBIT_EXECUTION_STATUS_DATA::default(),
33899 )),
33900 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
33901 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
33902 PARAM_EXT_REQUEST_LIST_DATA::default(),
33903 )),
33904 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
33905 PARAM_EXT_REQUEST_READ_DATA::default(),
33906 )),
33907 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
33908 PARAM_EXT_VALUE_DATA::ID => {
33909 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
33910 }
33911 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
33912 PARAM_REQUEST_LIST_DATA::ID => {
33913 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
33914 }
33915 PARAM_REQUEST_READ_DATA::ID => {
33916 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
33917 }
33918 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
33919 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
33920 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
33921 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
33922 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
33923 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
33924 POSITION_TARGET_GLOBAL_INT_DATA::default(),
33925 )),
33926 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
33927 POSITION_TARGET_LOCAL_NED_DATA::default(),
33928 )),
33929 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
33930 PROTOCOL_VERSION_DATA::ID => {
33931 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
33932 }
33933 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
33934 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
33935 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
33936 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
33937 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
33938 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
33939 RC_CHANNELS_OVERRIDE_DATA::default(),
33940 )),
33941 RC_CHANNELS_RAW_DATA::ID => {
33942 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
33943 }
33944 RC_CHANNELS_SCALED_DATA::ID => {
33945 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
33946 }
33947 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
33948 REQUEST_DATA_STREAM_DATA::default(),
33949 )),
33950 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
33951 RESOURCE_REQUEST_DATA::ID => {
33952 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
33953 }
33954 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
33955 RESPONSE_EVENT_ERROR_DATA::default(),
33956 )),
33957 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
33958 SAFETY_ALLOWED_AREA_DATA::default(),
33959 )),
33960 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
33961 SAFETY_SET_ALLOWED_AREA_DATA::default(),
33962 )),
33963 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
33964 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
33965 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
33966 SCALED_PRESSURE_DATA::ID => {
33967 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
33968 }
33969 SCALED_PRESSURE2_DATA::ID => {
33970 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
33971 }
33972 SCALED_PRESSURE3_DATA::ID => {
33973 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
33974 }
33975 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
33976 SERVO_OUTPUT_RAW_DATA::ID => {
33977 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
33978 }
33979 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
33980 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
33981 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
33982 )),
33983 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
33984 SET_ATTITUDE_TARGET_DATA::default(),
33985 )),
33986 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
33987 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
33988 )),
33989 SET_HOME_POSITION_DATA::ID => {
33990 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
33991 }
33992 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
33993 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
33994 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
33995 )),
33996 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
33997 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
33998 )),
33999 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
34000 SMART_BATTERY_INFO_DATA::ID => {
34001 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
34002 }
34003 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
34004 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
34005 STORAGE_INFORMATION_DATA::default(),
34006 )),
34007 SUPPORTED_TUNES_DATA::ID => {
34008 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
34009 }
34010 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
34011 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
34012 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
34013 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
34014 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
34015 TERRAIN_REQUEST_DATA::ID => {
34016 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
34017 }
34018 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
34019 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
34020 TIME_ESTIMATE_TO_TARGET_DATA::default(),
34021 )),
34022 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34023 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34024 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
34025 ))
34026 }
34027 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34028 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
34029 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
34030 ))
34031 }
34032 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
34033 UAVCAN_NODE_INFO_DATA::ID => {
34034 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
34035 }
34036 UAVCAN_NODE_STATUS_DATA::ID => {
34037 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
34038 }
34039 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
34040 UTM_GLOBAL_POSITION_DATA::default(),
34041 )),
34042 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
34043 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
34044 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
34045 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
34046 VICON_POSITION_ESTIMATE_DATA::default(),
34047 )),
34048 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
34049 VIDEO_STREAM_INFORMATION_DATA::default(),
34050 )),
34051 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
34052 VIDEO_STREAM_STATUS_DATA::default(),
34053 )),
34054 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
34055 VISION_POSITION_ESTIMATE_DATA::default(),
34056 )),
34057 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
34058 VISION_SPEED_ESTIMATE_DATA::default(),
34059 )),
34060 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
34061 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
34062 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
34063 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
34064 _ => None,
34065 }
34066 }
34067 #[cfg(feature = "arbitrary")]
34068 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
34069 match id {
34070 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34071 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
34072 )),
34073 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34074 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
34075 )),
34076 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
34077 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
34078 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
34079 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
34080 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34081 ATTITUDE_QUATERNION_DATA::random(rng),
34082 )),
34083 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34084 ATTITUDE_QUATERNION_COV_DATA::random(rng),
34085 )),
34086 ATTITUDE_TARGET_DATA::ID => {
34087 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
34088 }
34089 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
34090 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
34091 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34092 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34093 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
34094 ))
34095 }
34096 AUTOPILOT_VERSION_DATA::ID => {
34097 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
34098 }
34099 AVAILABLE_MODES_DATA::ID => {
34100 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
34101 }
34102 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34103 AVAILABLE_MODES_MONITOR_DATA::random(rng),
34104 )),
34105 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
34106 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
34107 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
34108 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34109 CAMERA_CAPTURE_STATUS_DATA::random(rng),
34110 )),
34111 CAMERA_FOV_STATUS_DATA::ID => {
34112 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
34113 }
34114 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34115 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
34116 )),
34117 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
34118 CAMERA_INFORMATION_DATA::random(rng),
34119 )),
34120 CAMERA_SETTINGS_DATA::ID => {
34121 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
34122 }
34123 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
34124 CAMERA_THERMAL_RANGE_DATA::random(rng),
34125 )),
34126 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
34127 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
34128 )),
34129 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34130 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
34131 )),
34132 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
34133 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
34134 CAN_FILTER_MODIFY_DATA::ID => {
34135 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
34136 }
34137 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
34138 CELLULAR_CONFIG_DATA::ID => {
34139 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
34140 }
34141 CELLULAR_STATUS_DATA::ID => {
34142 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
34143 }
34144 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34145 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
34146 )),
34147 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34148 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
34149 )),
34150 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
34151 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
34152 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
34153 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
34154 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
34155 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
34156 COMPONENT_INFORMATION_DATA::random(rng),
34157 )),
34158 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34159 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
34160 )),
34161 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
34162 COMPONENT_METADATA_DATA::random(rng),
34163 )),
34164 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34165 CONTROL_SYSTEM_STATE_DATA::random(rng),
34166 )),
34167 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34168 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
34169 )),
34170 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
34171 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
34172 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
34173 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
34174 )),
34175 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
34176 DEBUG_FLOAT_ARRAY_DATA::ID => {
34177 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
34178 }
34179 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
34180 DISTANCE_SENSOR_DATA::ID => {
34181 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
34182 }
34183 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
34184 ENCAPSULATED_DATA_DATA::ID => {
34185 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
34186 }
34187 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
34188 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
34189 ESTIMATOR_STATUS_DATA::ID => {
34190 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
34191 }
34192 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
34193 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
34194 EXTENDED_SYS_STATE_DATA::random(rng),
34195 )),
34196 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
34197 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34198 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
34199 )),
34200 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
34201 FLIGHT_INFORMATION_DATA::random(rng),
34202 )),
34203 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
34204 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
34205 GENERATOR_STATUS_DATA::ID => {
34206 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
34207 }
34208 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34209 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
34210 )),
34211 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
34212 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
34213 )),
34214 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
34215 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
34216 )),
34217 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
34218 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
34219 )),
34220 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
34221 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
34222 )),
34223 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34224 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
34225 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
34226 ))
34227 }
34228 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
34229 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
34230 )),
34231 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
34232 GIMBAL_MANAGER_STATUS_DATA::random(rng),
34233 )),
34234 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
34235 GLOBAL_POSITION_INT_DATA::random(rng),
34236 )),
34237 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
34238 GLOBAL_POSITION_INT_COV_DATA::random(rng),
34239 )),
34240 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34241 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
34242 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
34243 ))
34244 }
34245 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
34246 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
34247 GPS_GLOBAL_ORIGIN_DATA::ID => {
34248 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
34249 }
34250 GPS_INJECT_DATA_DATA::ID => {
34251 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
34252 }
34253 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
34254 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
34255 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
34256 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
34257 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
34258 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
34259 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
34260 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
34261 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
34262 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
34263 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
34264 )),
34265 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
34266 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
34267 HIL_OPTICAL_FLOW_DATA::ID => {
34268 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
34269 }
34270 HIL_RC_INPUTS_RAW_DATA::ID => {
34271 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
34272 }
34273 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
34274 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
34275 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
34276 HIL_STATE_QUATERNION_DATA::random(rng),
34277 )),
34278 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
34279 HYGROMETER_SENSOR_DATA::ID => {
34280 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
34281 }
34282 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
34283 ILLUMINATOR_STATUS_DATA::random(rng),
34284 )),
34285 ISBD_LINK_STATUS_DATA::ID => {
34286 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
34287 }
34288 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
34289 LINK_NODE_STATUS_DATA::ID => {
34290 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
34291 }
34292 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
34293 LOCAL_POSITION_NED_DATA::random(rng),
34294 )),
34295 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
34296 LOCAL_POSITION_NED_COV_DATA::random(rng),
34297 )),
34298 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34299 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
34300 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
34301 ))
34302 }
34303 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
34304 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
34305 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
34306 LOGGING_DATA_ACKED_DATA::random(rng),
34307 )),
34308 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
34309 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
34310 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
34311 LOG_REQUEST_DATA_DATA::ID => {
34312 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
34313 }
34314 LOG_REQUEST_END_DATA::ID => {
34315 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
34316 }
34317 LOG_REQUEST_LIST_DATA::ID => {
34318 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
34319 }
34320 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
34321 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
34322 MANUAL_SETPOINT_DATA::ID => {
34323 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
34324 }
34325 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
34326 MESSAGE_INTERVAL_DATA::ID => {
34327 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
34328 }
34329 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
34330 MISSION_CLEAR_ALL_DATA::ID => {
34331 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
34332 }
34333 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
34334 MISSION_CURRENT_DATA::ID => {
34335 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
34336 }
34337 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
34338 MISSION_ITEM_INT_DATA::ID => {
34339 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
34340 }
34341 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
34342 MISSION_ITEM_REACHED_DATA::random(rng),
34343 )),
34344 MISSION_REQUEST_DATA::ID => {
34345 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
34346 }
34347 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
34348 MISSION_REQUEST_INT_DATA::random(rng),
34349 )),
34350 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
34351 MISSION_REQUEST_LIST_DATA::random(rng),
34352 )),
34353 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
34354 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
34355 )),
34356 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
34357 MISSION_SET_CURRENT_DATA::random(rng),
34358 )),
34359 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
34360 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
34361 )),
34362 MOUNT_ORIENTATION_DATA::ID => {
34363 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
34364 }
34365 NAMED_VALUE_FLOAT_DATA::ID => {
34366 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
34367 }
34368 NAMED_VALUE_INT_DATA::ID => {
34369 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
34370 }
34371 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
34372 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
34373 )),
34374 OBSTACLE_DISTANCE_DATA::ID => {
34375 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
34376 }
34377 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
34378 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
34379 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
34380 )),
34381 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
34382 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
34383 )),
34384 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
34385 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
34386 )),
34387 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
34388 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
34389 )),
34390 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
34391 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
34392 )),
34393 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
34394 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
34395 )),
34396 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
34397 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
34398 )),
34399 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
34400 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
34401 )),
34402 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
34403 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
34404 )),
34405 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
34406 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
34407 )),
34408 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
34409 OPTICAL_FLOW_RAD_DATA::ID => {
34410 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
34411 }
34412 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
34413 ORBIT_EXECUTION_STATUS_DATA::random(rng),
34414 )),
34415 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
34416 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
34417 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
34418 )),
34419 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
34420 PARAM_EXT_REQUEST_READ_DATA::random(rng),
34421 )),
34422 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
34423 PARAM_EXT_VALUE_DATA::ID => {
34424 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
34425 }
34426 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
34427 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
34428 PARAM_REQUEST_LIST_DATA::random(rng),
34429 )),
34430 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
34431 PARAM_REQUEST_READ_DATA::random(rng),
34432 )),
34433 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
34434 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
34435 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
34436 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
34437 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
34438 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
34439 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
34440 )),
34441 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
34442 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
34443 )),
34444 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
34445 PROTOCOL_VERSION_DATA::ID => {
34446 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
34447 }
34448 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
34449 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
34450 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
34451 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
34452 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
34453 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
34454 RC_CHANNELS_OVERRIDE_DATA::random(rng),
34455 )),
34456 RC_CHANNELS_RAW_DATA::ID => {
34457 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
34458 }
34459 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
34460 RC_CHANNELS_SCALED_DATA::random(rng),
34461 )),
34462 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
34463 REQUEST_DATA_STREAM_DATA::random(rng),
34464 )),
34465 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
34466 RESOURCE_REQUEST_DATA::ID => {
34467 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
34468 }
34469 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
34470 RESPONSE_EVENT_ERROR_DATA::random(rng),
34471 )),
34472 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
34473 SAFETY_ALLOWED_AREA_DATA::random(rng),
34474 )),
34475 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
34476 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
34477 )),
34478 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
34479 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
34480 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
34481 SCALED_PRESSURE_DATA::ID => {
34482 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
34483 }
34484 SCALED_PRESSURE2_DATA::ID => {
34485 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
34486 }
34487 SCALED_PRESSURE3_DATA::ID => {
34488 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
34489 }
34490 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
34491 SERVO_OUTPUT_RAW_DATA::ID => {
34492 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
34493 }
34494 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
34495 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
34496 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
34497 )),
34498 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
34499 SET_ATTITUDE_TARGET_DATA::random(rng),
34500 )),
34501 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
34502 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
34503 )),
34504 SET_HOME_POSITION_DATA::ID => {
34505 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
34506 }
34507 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
34508 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
34509 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
34510 )),
34511 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
34512 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
34513 )),
34514 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
34515 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
34516 SMART_BATTERY_INFO_DATA::random(rng),
34517 )),
34518 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
34519 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
34520 STORAGE_INFORMATION_DATA::random(rng),
34521 )),
34522 SUPPORTED_TUNES_DATA::ID => {
34523 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
34524 }
34525 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
34526 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
34527 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
34528 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
34529 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
34530 TERRAIN_REQUEST_DATA::ID => {
34531 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
34532 }
34533 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
34534 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
34535 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
34536 )),
34537 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34538 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34539 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
34540 ))
34541 }
34542 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34543 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
34544 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
34545 ))
34546 }
34547 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
34548 UAVCAN_NODE_INFO_DATA::ID => {
34549 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
34550 }
34551 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
34552 UAVCAN_NODE_STATUS_DATA::random(rng),
34553 )),
34554 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
34555 UTM_GLOBAL_POSITION_DATA::random(rng),
34556 )),
34557 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
34558 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
34559 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
34560 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
34561 VICON_POSITION_ESTIMATE_DATA::random(rng),
34562 )),
34563 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
34564 VIDEO_STREAM_INFORMATION_DATA::random(rng),
34565 )),
34566 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
34567 VIDEO_STREAM_STATUS_DATA::random(rng),
34568 )),
34569 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
34570 VISION_POSITION_ESTIMATE_DATA::random(rng),
34571 )),
34572 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
34573 VISION_SPEED_ESTIMATE_DATA::random(rng),
34574 )),
34575 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
34576 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
34577 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
34578 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
34579 _ => None,
34580 }
34581 }
34582 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34583 match self {
34584 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
34585 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
34586 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
34587 Self::AIS_VESSEL(body) => body.ser(version, bytes),
34588 Self::ALTITUDE(body) => body.ser(version, bytes),
34589 Self::ATTITUDE(body) => body.ser(version, bytes),
34590 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
34591 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
34592 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
34593 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
34594 Self::AUTH_KEY(body) => body.ser(version, bytes),
34595 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
34596 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
34597 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
34598 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
34599 Self::BATTERY_INFO(body) => body.ser(version, bytes),
34600 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
34601 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
34602 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
34603 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
34604 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
34605 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
34606 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
34607 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
34608 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
34609 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
34610 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
34611 Self::CANFD_FRAME(body) => body.ser(version, bytes),
34612 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
34613 Self::CAN_FRAME(body) => body.ser(version, bytes),
34614 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
34615 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
34616 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
34617 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
34618 Self::COLLISION(body) => body.ser(version, bytes),
34619 Self::COMMAND_ACK(body) => body.ser(version, bytes),
34620 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
34621 Self::COMMAND_INT(body) => body.ser(version, bytes),
34622 Self::COMMAND_LONG(body) => body.ser(version, bytes),
34623 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
34624 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
34625 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
34626 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
34627 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
34628 Self::CURRENT_MODE(body) => body.ser(version, bytes),
34629 Self::DATA_STREAM(body) => body.ser(version, bytes),
34630 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
34631 Self::DEBUG(body) => body.ser(version, bytes),
34632 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
34633 Self::DEBUG_VECT(body) => body.ser(version, bytes),
34634 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
34635 Self::EFI_STATUS(body) => body.ser(version, bytes),
34636 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
34637 Self::ESC_INFO(body) => body.ser(version, bytes),
34638 Self::ESC_STATUS(body) => body.ser(version, bytes),
34639 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
34640 Self::EVENT(body) => body.ser(version, bytes),
34641 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
34642 Self::FENCE_STATUS(body) => body.ser(version, bytes),
34643 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
34644 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
34645 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
34646 Self::FUEL_STATUS(body) => body.ser(version, bytes),
34647 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
34648 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
34649 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
34650 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
34651 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
34652 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
34653 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
34654 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
34655 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
34656 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
34657 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
34658 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34659 Self::GPS2_RAW(body) => body.ser(version, bytes),
34660 Self::GPS2_RTK(body) => body.ser(version, bytes),
34661 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
34662 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
34663 Self::GPS_INPUT(body) => body.ser(version, bytes),
34664 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
34665 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
34666 Self::GPS_RTK(body) => body.ser(version, bytes),
34667 Self::GPS_STATUS(body) => body.ser(version, bytes),
34668 Self::HEARTBEAT(body) => body.ser(version, bytes),
34669 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
34670 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
34671 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
34672 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
34673 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
34674 Self::HIL_GPS(body) => body.ser(version, bytes),
34675 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
34676 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
34677 Self::HIL_SENSOR(body) => body.ser(version, bytes),
34678 Self::HIL_STATE(body) => body.ser(version, bytes),
34679 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
34680 Self::HOME_POSITION(body) => body.ser(version, bytes),
34681 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
34682 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
34683 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
34684 Self::LANDING_TARGET(body) => body.ser(version, bytes),
34685 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
34686 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
34687 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
34688 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
34689 Self::LOGGING_ACK(body) => body.ser(version, bytes),
34690 Self::LOGGING_DATA(body) => body.ser(version, bytes),
34691 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
34692 Self::LOG_DATA(body) => body.ser(version, bytes),
34693 Self::LOG_ENTRY(body) => body.ser(version, bytes),
34694 Self::LOG_ERASE(body) => body.ser(version, bytes),
34695 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
34696 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
34697 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
34698 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
34699 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
34700 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
34701 Self::MEMORY_VECT(body) => body.ser(version, bytes),
34702 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
34703 Self::MISSION_ACK(body) => body.ser(version, bytes),
34704 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
34705 Self::MISSION_COUNT(body) => body.ser(version, bytes),
34706 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
34707 Self::MISSION_ITEM(body) => body.ser(version, bytes),
34708 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
34709 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
34710 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
34711 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
34712 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
34713 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
34714 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
34715 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
34716 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
34717 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
34718 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
34719 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
34720 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
34721 Self::ODOMETRY(body) => body.ser(version, bytes),
34722 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
34723 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
34724 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
34725 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
34726 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
34727 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
34728 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
34729 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
34730 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
34731 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
34732 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
34733 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
34734 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
34735 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
34736 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
34737 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
34738 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
34739 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
34740 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
34741 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
34742 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
34743 Self::PARAM_SET(body) => body.ser(version, bytes),
34744 Self::PARAM_VALUE(body) => body.ser(version, bytes),
34745 Self::PING(body) => body.ser(version, bytes),
34746 Self::PLAY_TUNE(body) => body.ser(version, bytes),
34747 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
34748 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
34749 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
34750 Self::POWER_STATUS(body) => body.ser(version, bytes),
34751 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
34752 Self::RADIO_STATUS(body) => body.ser(version, bytes),
34753 Self::RAW_IMU(body) => body.ser(version, bytes),
34754 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
34755 Self::RAW_RPM(body) => body.ser(version, bytes),
34756 Self::RC_CHANNELS(body) => body.ser(version, bytes),
34757 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
34758 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
34759 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
34760 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
34761 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
34762 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
34763 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
34764 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
34765 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
34766 Self::SCALED_IMU(body) => body.ser(version, bytes),
34767 Self::SCALED_IMU2(body) => body.ser(version, bytes),
34768 Self::SCALED_IMU3(body) => body.ser(version, bytes),
34769 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
34770 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
34771 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
34772 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
34773 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
34774 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
34775 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
34776 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
34777 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
34778 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
34779 Self::SET_MODE(body) => body.ser(version, bytes),
34780 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
34781 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
34782 Self::SIM_STATE(body) => body.ser(version, bytes),
34783 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
34784 Self::STATUSTEXT(body) => body.ser(version, bytes),
34785 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
34786 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
34787 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
34788 Self::SYS_STATUS(body) => body.ser(version, bytes),
34789 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
34790 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
34791 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
34792 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
34793 Self::TIMESYNC(body) => body.ser(version, bytes),
34794 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
34795 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
34796 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
34797 Self::TUNNEL(body) => body.ser(version, bytes),
34798 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
34799 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
34800 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
34801 Self::V2_EXTENSION(body) => body.ser(version, bytes),
34802 Self::VFR_HUD(body) => body.ser(version, bytes),
34803 Self::VIBRATION(body) => body.ser(version, bytes),
34804 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34805 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
34806 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
34807 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34808 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
34809 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
34810 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
34811 Self::WINCH_STATUS(body) => body.ser(version, bytes),
34812 Self::WIND_COV(body) => body.ser(version, bytes),
34813 }
34814 }
34815 fn extra_crc(id: u32) -> u8 {
34816 match id {
34817 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
34818 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
34819 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
34820 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
34821 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
34822 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
34823 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
34824 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
34825 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
34826 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
34827 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
34828 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34829 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
34830 }
34831 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
34832 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
34833 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
34834 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
34835 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
34836 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
34837 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
34838 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
34839 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
34840 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
34841 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
34842 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
34843 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
34844 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
34845 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
34846 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
34847 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
34848 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
34849 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
34850 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
34851 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
34852 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
34853 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
34854 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
34855 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
34856 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
34857 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
34858 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
34859 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
34860 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
34861 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
34862 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
34863 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
34864 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
34865 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
34866 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
34867 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
34868 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
34869 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
34870 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
34871 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
34872 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
34873 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
34874 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
34875 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
34876 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
34877 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
34878 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
34879 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
34880 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
34881 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
34882 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
34883 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
34884 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
34885 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
34886 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
34887 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
34888 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34889 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
34890 }
34891 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
34892 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
34893 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
34894 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
34895 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34896 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
34897 }
34898 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
34899 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
34900 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
34901 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
34902 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
34903 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
34904 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
34905 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
34906 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
34907 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
34908 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
34909 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
34910 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
34911 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
34912 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
34913 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
34914 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
34915 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
34916 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
34917 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
34918 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
34919 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
34920 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
34921 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
34922 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
34923 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
34924 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
34925 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
34926 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
34927 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34928 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
34929 }
34930 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
34931 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
34932 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
34933 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
34934 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
34935 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
34936 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
34937 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
34938 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
34939 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
34940 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
34941 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
34942 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
34943 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
34944 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
34945 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
34946 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
34947 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
34948 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
34949 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
34950 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
34951 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
34952 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
34953 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
34954 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
34955 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
34956 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
34957 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
34958 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
34959 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
34960 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
34961 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
34962 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
34963 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
34964 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
34965 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
34966 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
34967 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
34968 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
34969 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
34970 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
34971 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
34972 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
34973 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
34974 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
34975 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
34976 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
34977 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
34978 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
34979 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
34980 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
34981 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
34982 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
34983 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
34984 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
34985 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
34986 PING_DATA::ID => PING_DATA::EXTRA_CRC,
34987 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
34988 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
34989 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
34990 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
34991 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
34992 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
34993 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
34994 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
34995 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
34996 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
34997 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
34998 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
34999 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
35000 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
35001 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
35002 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
35003 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
35004 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
35005 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
35006 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
35007 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
35008 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
35009 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
35010 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
35011 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
35012 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
35013 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
35014 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
35015 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
35016 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
35017 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
35018 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
35019 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
35020 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
35021 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
35022 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
35023 }
35024 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
35025 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
35026 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
35027 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
35028 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
35029 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
35030 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
35031 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
35032 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
35033 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
35034 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
35035 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
35036 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
35037 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
35038 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35039 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
35040 }
35041 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35042 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
35043 }
35044 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
35045 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
35046 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
35047 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
35048 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
35049 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
35050 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
35051 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
35052 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
35053 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
35054 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
35055 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
35056 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
35057 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
35058 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
35059 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
35060 _ => 0,
35061 }
35062 }
35063 fn target_system_id(&self) -> Option<u8> {
35064 match self {
35065 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
35066 Self::CANFD_FRAME(inner) => Some(inner.target_system),
35067 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
35068 Self::CAN_FRAME(inner) => Some(inner.target_system),
35069 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
35070 Self::COMMAND_ACK(inner) => Some(inner.target_system),
35071 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
35072 Self::COMMAND_INT(inner) => Some(inner.target_system),
35073 Self::COMMAND_LONG(inner) => Some(inner.target_system),
35074 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
35075 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
35076 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
35077 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
35078 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
35079 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
35080 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
35081 Self::LOGGING_ACK(inner) => Some(inner.target_system),
35082 Self::LOGGING_DATA(inner) => Some(inner.target_system),
35083 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
35084 Self::LOG_ERASE(inner) => Some(inner.target_system),
35085 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
35086 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
35087 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
35088 Self::MISSION_ACK(inner) => Some(inner.target_system),
35089 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
35090 Self::MISSION_COUNT(inner) => Some(inner.target_system),
35091 Self::MISSION_ITEM(inner) => Some(inner.target_system),
35092 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
35093 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
35094 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
35095 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
35096 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
35097 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
35098 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
35099 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
35100 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
35101 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
35102 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
35103 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
35104 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
35105 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
35106 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
35107 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
35108 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
35109 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
35110 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
35111 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
35112 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
35113 Self::PARAM_SET(inner) => Some(inner.target_system),
35114 Self::PING(inner) => Some(inner.target_system),
35115 Self::PLAY_TUNE(inner) => Some(inner.target_system),
35116 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
35117 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
35118 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
35119 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
35120 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
35121 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
35122 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
35123 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
35124 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
35125 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
35126 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
35127 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
35128 Self::SET_MODE(inner) => Some(inner.target_system),
35129 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
35130 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
35131 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
35132 Self::TIMESYNC(inner) => Some(inner.target_system),
35133 Self::TUNNEL(inner) => Some(inner.target_system),
35134 Self::V2_EXTENSION(inner) => Some(inner.target_system),
35135 _ => None,
35136 }
35137 }
35138 fn target_component_id(&self) -> Option<u8> {
35139 match self {
35140 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
35141 Self::CANFD_FRAME(inner) => Some(inner.target_component),
35142 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
35143 Self::CAN_FRAME(inner) => Some(inner.target_component),
35144 Self::COMMAND_ACK(inner) => Some(inner.target_component),
35145 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
35146 Self::COMMAND_INT(inner) => Some(inner.target_component),
35147 Self::COMMAND_LONG(inner) => Some(inner.target_component),
35148 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
35149 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
35150 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
35151 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
35152 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
35153 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
35154 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
35155 Self::LOGGING_ACK(inner) => Some(inner.target_component),
35156 Self::LOGGING_DATA(inner) => Some(inner.target_component),
35157 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
35158 Self::LOG_ERASE(inner) => Some(inner.target_component),
35159 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
35160 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
35161 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
35162 Self::MISSION_ACK(inner) => Some(inner.target_component),
35163 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
35164 Self::MISSION_COUNT(inner) => Some(inner.target_component),
35165 Self::MISSION_ITEM(inner) => Some(inner.target_component),
35166 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
35167 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
35168 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
35169 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
35170 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
35171 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
35172 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
35173 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
35174 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
35175 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
35176 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
35177 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
35178 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
35179 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
35180 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
35181 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
35182 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
35183 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
35184 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
35185 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
35186 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
35187 Self::PARAM_SET(inner) => Some(inner.target_component),
35188 Self::PING(inner) => Some(inner.target_component),
35189 Self::PLAY_TUNE(inner) => Some(inner.target_component),
35190 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
35191 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
35192 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
35193 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
35194 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
35195 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
35196 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
35197 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
35198 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
35199 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
35200 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
35201 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
35202 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
35203 Self::TIMESYNC(inner) => Some(inner.target_component),
35204 Self::TUNNEL(inner) => Some(inner.target_component),
35205 Self::V2_EXTENSION(inner) => Some(inner.target_component),
35206 _ => None,
35207 }
35208 }
35209}